Jump to content
adrianofina

Javascript product fields setting

Recommended Posts

Hello to all,

as the title suggests I need to configure Javascript code in some Prestashop pages (to be precise, the Cart, the product page and Checkout).

The code to edit is as follows, could you give me a hand on "how to" call values like "SKU", "NAME", "CATEGORYNAME", etc?

        <script type="text/javascript">
            // Set the view of a product
            _paq.push(['setEcommerceView',
                "SKU", // (required) SKU: Product unique identifier
                "NAME", // (optional) Product name
                "CATEGORYNAME", // (optional) Product category. You can also specify an array of up to 5 categories eg. ["CATEGORYNAME", "CATEGORYNAME2", "CATEGORYNAME3"]
                20, // (recommended) Product price
            ]);
            // Set the view of a category
            _paq.push(['setEcommerceView',
                false,
                false,
                "CATEGORYNAME", // You can also specify an array of up to 5 categories eg. ["CATEGORYNAME", "CATEGORYNAME2", "CATEGORYNAME3"]
            ]);
            _paq.push(['trackPageView']);
        </script>

I would be immensely grateful.

Thanks

Share this post


Link to post
Share on other sites

The products in the cart can be accessed via JS variable prestashop.cart.products

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More