Creació |
15
juny
2016
|
Activitat |
08
gen.
2018
|
BrightSide Financials includes shopping cart and checkout macros. Both will expand in a normal Elephant context and both will read the same shop configuration. Let's see this configuration and macros interactions.
The shopping cart configuration file is located at WEB-INF/elephant/conf/shop.xml
. Here is an example:
<elephant-shop version="1.0"> <CartPath value="/cart"/> <CheckoutPath value="/cart/checkout"/> <NotificationPath value="/cart/checkout/"/> <OKPath value="/cart/OK"/> <KOPath value="/cart/KO"/> <Store value=""/> <Bank value=""/> <Delivery value="Delivery"/> <Fiscal value="Fiscal"/> <Logistic value=""/> <ContactPhone value="Contact phone"/> <Locale value="en"/> <Currency value="EUR"/> <MerchantCode value=""/> <MerchantTerminal value=""/> <MerchantCurrency value=""/> <MerchantKey value=""/> <MerchantKeyType value=""/> <MerchantKeyLanguage value=""/> <MerchantTestScope value="true"/> <DeliveryByZipcode value="" product=""/> </elephant-shop>
BrightSide Financials products can be added to the shopping cart. To create the shopping cart context, simply create a normal context with the path configured in CartPath. Once created, edit adding this content:
{
Save. That's all. Now all product listings can include the Add to cart button.
Is important to notice that path-to-product-listing
isn't forced in configuration file. The reason is you can create as many product listing contexts as you want. They will add to the same shopping cart, no matter where they come from.
In order to send the shopping cart to the POS, you need a checkout context. Checkout context will:
Now, create a checkout context with the path configured in CheckoutPath. In most cases, NotificationPath will be exactly the same value with a final slash. If in doubt, follow this guide. Once created, edit and add this content:
{
Now you have a checkout context.
The POS will redirect to OKPath
or KOPath
, depending on payment success. Create both contexts with according messages.
The shopping cart and the checkout contexts were both created with a single macro as content. That's correct for most cases, since messages are already configured. Because there is a single macro, we don't need wiki syntax thus, the first line deactivate it.
If you feel the user may need more information, you're free to add the macro within more rich content. Avoid mixing both macros in the same context.
Both macros expand to default templates. If you need to modify inside content, simply edit this templates.