Snippet OfficeMiniShop2 shows the miniShop2 orders history of a current user. Everything is built on ExtJS, which is very convenient. It is loaded from the installed MODX, and that is why it can look differently on different versions of MODX.
Orders history output settings work approximately the same as for miniShop2:
You can indicate your CSS file with the ExtJS structure.
Unlike miniShop2, you can add to the snippet 3 extra parameters:
- allowRemove - turn on the opportunity to delete orders with the "New" status
- allowRepeat - turn on the opportunity to repeat an order.
- cartLink - link to the cart with the order.
Work logic of the order repeat is the following:
- If repeat is allowed, there is a special icon in the orders table.
- When you click it, goods from the order apper in the session as if the user added them to the cart.
- Then, if parameter cartLink is not empty, the user is redirected to the indicated page of placing the order.
They choose method of delivery, fill in or change address fields.
- If this parameter is empty, the order is made at once and everything is copied from the old one.
Notice that, if the order being copied was made long ago and since then your rules of placing orders have changed, making an order without a cart can give oneself an error. For example, now you require to write the address and there is no address in the old order - then there will be an error about not filling in the necessary fields.
[[!officeMiniShop2? &allowRemove=`1` &allowRepeat=`1` &cartLink=`/order/cart` ]]