webmatch / WbmTagManager

Shopware 5 Plugin for Google Tag Manager integration and dataLayer configuration
27 stars 19 forks source link

Which smarty variable for add to cart #24

Closed timoburmeister closed 5 years ago

timoburmeister commented 5 years ago

hi @dneustadt,

thanks for this very helpful plugin. Nevertheless I do not get the datalayer filled with information regarding the add to cart event (on the product detail page). Only two variables work: quantity and id. everything else is not filled out.

I tried this config:

grafik

grafik

Any hint would be appreciated..

thanks in advance!

dneustadt commented 5 years ago

Hi, the controller action that is mapped to the addToCart event is an XHR endpoint and therefore does not have a template with variables. The variable $sArticle is not available at that point. Please refer to the default database content of the latest version to find solutions as how to retrieve the price and further informations: https://github.com/webmatch/WbmTagManager/blob/master/Resources/sql/install.sql#L40 Also see the manual on how to use the dbquery smarty function on how to retrieve data from the database: https://github.com/webmatch/WbmTagManager#dbquery