Get product and catalog from order/product in confirmation template

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
heural
Posts: 58
Joined: 09 Jun 2022, 07:55

Get product and catalog from order/product in confirmation template

Post by heural » 30 May 2023, 14:26

Hi Aimeos-Teams,

for google tag manager tracking purposes, I need the catalog(s) in the order confirmation template (client/html/checkout/confirm/body) for each product.

Is there a way to retrieve the product item "MShop/Product/Item/Standard" and the attached catalog(s) withhin the iteration from $this->summaryBasket->getProducts() in this template?

Thank you!

User avatar
aimeos
Administrator
Posts: 7881
Joined: 01 Jan 1970, 00:00

Re: Get product and catalog from order/product in confirmation template

Post by aimeos » 31 May 2023, 08:59

You have to create a decorator which fetches the product items including the categories for the ordered products in the basket and pass that to the view:
https://aimeos.org/docs/latest/frontend ... omponents/

In 2023.07+, you will be able to configure which related domains are loaded:
https://github.com/aimeos/ai-client-htm ... #L124-L140
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

heural
Posts: 58
Joined: 09 Jun 2022, 07:55

Re: Get product and catalog from order/product in confirmation template

Post by heural » 31 May 2023, 09:37

Ok thank you.
That are my thoughts also, but in the docu/configure there are no decorator-params for html-client/checkout/confirm,
only overwrite the standard impl: https://aimeos.org/docs/latest/config/c ... firm/#name

So that should be: client/html/checkout/confirm/decorators/(global|local|excludes)

For understanding: have all html-client objects these decorator pattern and the docu is missing that in some places?
e.g. the basket-mini have it:
https://aimeos.org/docs/latest/config/c ... decorators

User avatar
aimeos
Administrator
Posts: 7881
Joined: 01 Jan 1970, 00:00

Re: Get product and catalog from order/product in confirmation template

Post by aimeos » 31 May 2023, 10:49

Decorators can be applied to any HTML client component. The missing documentation has been added again in the code and will be available on the web site with the next release.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply