• Resolved simkog

    (@simkog)


    Dear Developer,

    I use this plugin to integrate Google Analytics 4 and Facebook (Meta) Pixel into my websites. Everything work as it should except for one thing.

    I have a product (hidden one) with a negative price to justify the total price of the cart when two or more products were added to the cart (custom quantity-based pricing). It is automatically added to the cart based on product quantity.

    I can see this hidden product in the cart and checkout dataLayer variable, but the price is 0 (zero) and by this, the cart and checkout total is incorrect (the discount is missing both times).

    My question is, your plugin assumes that the product price is always greater than zero?

    My checkout summary: https://i.imgur.com/8bHEsr3.png
    dataLayer in GTM test: https://i.imgur.com/O5gFUhc.png

    Thank you for your help,
    Gergo Simko

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi Gerg?,

    GTM4WP uses wc_get_price_to_display() to query product prices either including or excluding taxes (different countries require different calculation)

    This might round your negative prices to 0.

    Thread Starter simkog

    (@simkog)

    Hi Thomas,

    I see. This is the problem. It seems Woocommerce doesn’t like negative values for product nor fees. I need to rewrite this quantity based “plugin” of mine. Thanks for your answer!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with negative product price’ is closed to new replies.