• Resolved wpmigo

    (@wpmigo)


    Hello.

    We’ve notices an issue related to ‘AddToCart’ event – missing catalog product for the variable products.

    In the advanced settings I’ve enabled the option to not track the variable products as product group.
    https://i.imgur.com/EPloWmf.jpg

    The problem is that for example on the single product page the ID corresponds to the parent product ID, but on the cart page the variation ID is used – which is missing from the catalog.

    Is there a solution for that ?

    Thank you.

    • This topic was modified 5 years, 6 months ago by wpmigo.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Same issue here.

    Content fires correctly with product ID (example 101024) but in Cart and checkout the ID become different (example 101032) and the catalogue doesn’t match it

    Maybe you have some solution for that?

    It’s been ages since I have problems with my variable products and the creation of a catalogue

    • This reply was modified 5 years, 6 months ago by geck888.
    Thread Starter wpmigo

    (@wpmigo)

    @adespresso any idea how to fix this ?

    Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi,

    apologies for the large delay, I’m here now to assist you on the issue!

    So, what you requested is clearly a problem, but not related to the option you shown on the screen, because of that option only set product instead of product_group in the content_type.

    I can add a new option in the next release in order to force parent ID from a variation, in order to match the product catalog.

    For now, I made a workaround: copy and paste the following code in the functions.php file of your current theme or in a new plugin:

    
    function aepc_force_parent_id($params, $event){
        if (!empty($params['content_ids'])) {
            foreach ($params['content_ids'] as &$id) {
                if (($product = wc_get_product($id)) && $product->is_type('variation')) {
                    $id = (string) $product->get_parent_id();
                }
            }
            $params['content_ids'] = array_unique($params['content_ids']);
        }
    
        return $params;
    };
    add_filter('aepc_event_parameters', 'aepc_force_parent_id', 10, 2);
    add_filter('aepc_allowed_standard_event_params', 'aepc_force_parent_id', 10, 2);
    

    In this way, you will force the parent ID for the variations found inside the content_ids parameter.

    I hope it can help you, let me know.

    Thread Starter wpmigo

    (@wpmigo)

    Thank you Antonio.

    Yes, that helps to have the same parent ID.

    Thank you!

    Plugin Author Antonino Scarfì

    (@antoscarface)

    I’m glad it helped you!
    You’re very welcome! ??

    @antoscarface

    Hi how are you? I hope you can help me please. I have the pixel caffeine plugin installed, but when I am in my ad manager it tells me that there is a problem with the add to cart event.
    I am using the plugin in the free version that is in wordpress, does this have something to do with it?
    The Facebook team told me that I had to insert the pixel code into the same wordpress code, but I am not a programmer and I really believe that manipulating the code will affect the plugin. Could you help me please?

    mi website issue is : https://www.body.pe

    thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘AddToCart event issue for variable products’ is closed to new replies.