Flamingo Commerce Training Product and Cart Modules
1.
2. Flamingo Commerce Training
This Training includes examples that require to have
the commerce-demo-carotene running
https://github.com/i-love-flamingo/commerce-demo-carotene#run-local-from-source-code
3. Flamingo Commerce Training
• Product Module:
• Show a specific product (e.g. CMS)
• Understanding the Model
• Displaying Prices
• Showing product widgets
• Product Singe Page
• Access Attributes
• Configurables
• Cart:
• Adding via Ajax
• Show Tax / Shipping / Discounts
7. Render a product
Task:
Solution Hints:
Teaser a product on the „special offers“ page : http://localhost:3210/en/offers
• Look at the product package template functions
• product with marketplacecode „awesome-retailer_6981068“ - has special price
maintained if you want to display „Streichpreis“
8. List some products
Task:
Solution Hints:
List products on the offer page : http://localhost:3210/en/offers
• Use findProducts template function
10. Configurable
selection by attribute dimensions
Task:
Solution Hints:
Change the product single view to show a select of color and size when opening the
configurable:
http://localhost:3210/en/product/hellokitty-configurable/hello-kitty.html
• debug the template variable „variantSelection“
11. Prices and Charges
5 €
Price: 50 Miles
Value: 5€
main:
Price 2 €
Value 2 €
loyalty:
Price 30 Miles
Value 3€
12. Prices and Charges
Round to currency
unit (e.g. cent)
Split in multiple prices.
E.g. 0.4 / 3 = 0.1+0.1+0.2
14. Cart Model
Cart
Delivery
Items
• Multi Delivery Cart
• (Valued) Prices are present only on item level. All other prices are calculated
• Discounts are also per Item
15. Cart Model
Cart
• Cart is immutable: Only use CartService to receive or manipulate it
• The CartService acts also as the main „Secondary Port“ that need to be
implemented
• There is a „InmemoryCartService“ included as example
<<immutable>>
<<secondary port>>
CustomerCartService
<<secondary port>>
GuestCartService
16. Cart Model
Product
• Often you need the product data together with the item
• Use a DecoratedCart instead of Cart then
DecoratedCartFactory DecoratedCart
DecoratedItem
DecoratedDelivery
Item
17. Cart Module
Cart
• In the application service there is:
• support for caching the cart (in session)
• cartService that makes sure that after modifiing a cart it is updated in
cache
<<immutable>>
<<secondary
port>>
*CartService
CartReceiverService
CartCache
CartService
19. Show some more
cart prices
Task:
Solution Hints:
• Look at the cart package or the documentation
20. Cart PaymentSelection &
Payment
1.) The customer select a payment:
• this „wish“ of the customer need to be saved as „PaymentSelection“ on the cart
• A PaymentSelection can also contain the information about:
• which Charges a customer want to pay
• what (payment) method he wants to use
• For example he might want to pay the value of 50€:
• with 200 Miles using „milespayment“ (that match a value of 20€)
• and 20 € using Creditcart
• and 10€ using Paypal
2.) When placing the cart:
• a payment need to be passed with the correct Payment and Payment Transactions
(that matches the selection)
23. Cart Module
• The interface layer contains
• form and formhandlers (using flamingo.me/forms)
• controller and (ajax) apicontroller to work with the cart
CartApiController
CartController
BillingForm
DeliveryForm
PersonalDataForm
PaymentForm
CartService
24. Add a product to cart via ajax
Task:
Solution Hints:
Just add a product to cart with ajax and find out whats happening
• print routes or look in module.go of cart package
26. Checkout (Module dep)
Cart Module
Checkout Module
Payment Module
Comes with a
default checkout
you may want to
use
Define port for
WebPaymentGateway
27. Skip the review step
Task:
Solution Hints:
checkout form submit should just place the order
• check the configuration options
28. Customer should select
pickup location
Task:
Solution Hints:
Add a selection for pickup location, that gets persited in cart:
• check the delivery form inside cart package that is used there