Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1012590

    In order for the View Content pixel from facebook to fire, the woocommerce_after_single_product needs to be on the product page. Can I add this back in without it affecting the Theme? If so, how do I enable it.

    #1012806

    Hey MonumentBrandsLLC,

    Thank you for using Enfold.

    I’m not sure I understand the issue. Where do you need that hook to be? The theme doesn’t remove it.

    Best regards,
    Ismael

    #1012814

    Hello,
    I researched and saw that this was the hook that triggered the facebook pixel to mark a “View Content”. This should happen whenever someone goes to a product page. For some reason, Facebook isn’t picking up that our product pages are products. What details could I provide in order for you to determine the issue?

    #1012826

    Hi,

    Enfold does not use a special template for shop or product pages – thus you can use the woocommerce_after_single_product action to add custom code to your product page without customizing the theme. You can use the action like:

    
    add_action( 'woocommerce_after_single_product', 'avia_add_custom_code_after_single_product',10);
    function avia_add_custom_code_after_single_product()
    {
    	echo 'Some code which is hooked on the woocommerce_after_single_product action!';
    }
    

    The sample code would add the sentence “Some code which is hooked on the woocommerce_after_single_product action!” to your product page. Note that the hooks won’t work on pages which use the advanced layout builder. You could use the filter like:

    
    function avia_single_product_page_mod($content)
    {
        if (is_product())
        {
            /*
            Insert your code here
             */
        }
        return $content;
    }
    add_filter('avia_builder_precompile', 'avia_single_product_page_mod', 10, 1 );
    

    and below “Insert your code here” you can add your code.

    Best regards,
    Peter

    #1012827

    So that may be the problem right there. I am using the advanced layout builder on the product pages currently. Is this causing ALL hooks that exist to no longer function? If that’s the case, they wouldn’t be firing the pixel because there is no hook.

    #1012842

    function avia_single_product_page_mod($content)
    {
    if (is_product())
    {
    /*
    Insert your code here
    */
    }
    return $content;
    }
    add_filter(‘avia_builder_precompile’, ‘avia_single_product_page_mod’, 10, 1 );

    and this isn’t working when I try to save on my child theme functions.php

    #1012849

    Just switched the theme back to what we were using before (Porto) and all pixels fire correctly on the product page. Hence, it is definitely something to do with the Enfold Theme that is causing the issue. Does the theme remove woocommerce hooks? If so, which ones and how do I enable them to work?

    The Enfold theme is beautiful and easy to use, but it is already causing a loss of sales and ad optimizing. If this can’t be fixed, we’ll have to switch back to the Porto theme.

    #1013082

    Hi,

    Does the theme remove woocommerce hooks?

    No the theme does not remove any hooks as long as you’re using the default wordpress editor. If you switch to the advanced layout builder the advanced layout builder templates are used which do not use/support woocommerce hooks out of the box.

    Thus – if you want to use WooCommerce hooks – switch to the default editor. Then the default WooCommerce templates will be used and you can also use the woocommerce_after_single_product action.

    Best regards,
    Peter

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.