• I would like to know if it’s possible this:

    When an order is placed, and the customer buys some variable products, the plugin on the purchase page gives me the IDs of the variants
    Can I get the IDs of the parent product, in order to match it with my Facebook Product catalog?

    I have noticed also that on Add to Cart event also, the IDs that are sent are the ones of the variants and not the ones of the parent product. Can this be changed?

    • This topic was modified 5 years, 9 months ago by elavd.
    • This topic was modified 5 years, 9 months ago by elavd.
Viewing 1 replies (of 1 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    This can be done by adding custom codes to your site.
    You may want to write a code that hooks into the WP filter gtm4wp_eec_product_array and checks the second filter argument which will be “purchase” on the order received page. The first argument will be a single product in your order (thus this filter is called as many times as many products the order has)

    Here you can populate a WP_Product class and call the get_product_id() member function

Viewing 1 replies (of 1 total)
  • The topic ‘How to get the IDs of the (parent) variable products on Add to cart & purchase’ is closed to new replies.