matdave
(Matthew Jones)
June 28, 2017, 7:25pm
#1
Here is a simple Gist for retrieving a logged in user’s previous shipping and billing information details. Place it on the CART and not the checkout page.
sclastorderdetails.example.tpl
[[!FormIt?
&store=`1`
&hooks=`spam,redirect`
&submitVar=`checkout`
&redirectTo=`[[*id:scFirstChild]]`
]]
[[!scLastOrderDetails]]
<div id="simplecart">
<form action="[[~[[*id]]]]" method="post" id="form_cartoverview">
This file has been truncated. show original
sclastorderdetails.snippet.php
<?php
/**
* [[!scLastOrderDetails]]
* Retrieve Last Order Details
* Place this snippet on the CART before checkout and set your formit call to &store=`1`
*/
$user = $modx->getUser();
if($user && $user->isAuthenticated($modx->resource->get('context_key')) {
$id = $user->get('id');
This file has been truncated. show original
1 Like