Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1258814

    Hello,

    Can you please guide me to add a header to some specific Woocommerce pages ?
    Please see the details in private.

    Thanks !

    #1258854

    Hey longip,

    Please refer to this post – https://kriesi.at/documentation/enfold/intro-to-layout-builder/#debug-mode and enable ALB debugging mode.
    Then edit your page where you have your header and copy shortcode of the section you would like to insert to the top of your product.
    Then add following code to Functions.php file of your child theme and replace the shortcode

    add_action('woocommerce_before_single_product','av_woocommerce_before_single_product');
    function av_woocommerce_before_single_product(){
    if(is_product(7791)){
    	echo do_shortcode("[Your shortcode goes here]");
    }}

    Best regards,
    Yigit

    #1258963

    Hello Yigit,

    Thank you for your reply!

    By editing the product do you mean to add the shortcode on top of the description of the product ?
    Because I did this and I do not get the expected result.

    The page become a complete mess but look a bit like what I want to achieve :)

    #1259281

    Hi,

    No, you would need to edit the page where you have text star etc. :)

    If you would like us to do it for you, please post FTP and WP admin logins here privately :)

    Best regards,
    Yigit

    #1259644

    Sorry, but I do not understand.
    Why do I have to edit the page ? The page it is OK as it is.

    I want to have the same data as in the page on top of the product pages of WooCommerce.

    #1259872

    Hi,

    You would need to edit the page to get the shortcode of the section :)

    It is the section I showed in screenshot in private content field that you would like to display on top of every single product page, is that correct?
    If so, you would need to use the code as following

    add_action('woocommerce_before_single_product','av_woocommerce_before_single_product');
    function av_woocommerce_before_single_product(){
    if(is_product()){
    	echo do_shortcode("[Your shortcode goes here]");
    }}

    Best regards,
    Yigit

    #1259935

    So sorry, but it does not work. Please see private.

    #1260904

    Hi,

    Thank you for the updat.e

    What do you mean exactly by “Woocommerce pages”? Are you referring to the product category pages or the single product pages? You should replace the shortcode above with the actual markup of the layout in the screenshot, and instead of using woocommerce_before_single_product, try to use the ava_after_main_container hook so that the content renders below the header.

    Best regards,
    Ismael

    #1262080

    Sorry for my late reply. But, it does not work. Please see private.

    #1262890

    Hi,

    Thank you for the update.

    You may need to extract the actual markup or html instead of using the shortcodes because the theme closes the containers prematurely, which breaks the layout the page. This is the extracted markup from the above shortcode.

    // https://pastebin.com/MXRuBuep

    Best regards,
    Ismael

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