Unlocking the Future of AI Agents with Large Language Models
Â
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-ďŹamingo/commerce-demo-carotene#run-local-from-source-code
3. Flamingo Commerce Training
⢠Product Module:
⢠Show a speciďŹc product (e.g. CMS)
⢠Understanding the Model
⢠Displaying Prices
⢠Showing product widgets
⢠Product Singe Page
⢠Access Attributes
⢠ConďŹgurables
⢠Cart:
⢠Adding via Ajax
⢠Show Tax / Shipping / Discounts
7. Render a product
Task:
Solution Hints:
Teaser a product on the âspecial oďŹersâ page : http://localhost:3210/en/oďŹers
⢠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 oďŹer page : http://localhost:3210/en/oďŹers
⢠Use ďŹndProducts 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
conďŹgurable:
http://localhost:3210/en/product/hellokitty-conďŹgurable/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 modiďŹing 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 ďŹamingo.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 ďŹnd 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
DeďŹne port for
WebPaymentGateway
27. Skip the review step
Task:
Solution Hints:
checkout form submit should just place the order
⢠check the conďŹguration 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