Home Forums WoodMart support forum Add the same extra block in all products code…

Add the same extra block in all products code…

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

    stvlahos
    Participant

    I would like to add for example a shortcode to all products in the position of extra box . (I dont want to use extra box in every product separate)
    What should I do. ..

    Now I am writing .

    add_action( ‘woocommerce_single_product_summary’, ‘custom_shortcode’, 40 );

    function custom_shortcode() {
    echo do_shortcode(‘[html_block id="16367"]‘);
    }

    but is going under the tabs (I have the tabs at right side and when I open or close the “block” goes under the main image.

    I would like exactly in the position of Extra content before the meta info (sku categoreis social) and after product descriptions tab.

    as a conclusion how can I have in all products enabled the same extra content

    It is very important to help me. thank you in advanced.. I am trying .. 2 days .

    thank you !

    #456318

    Hello,

    Thank you very much for choosing our theme and for contacting us.

    WoodMart theme provides a few ways to add custom content to the product page:

    Additional tabs – You can find the option in the Theme Settings > Single product > Tabs = globally for all the products.

    Additional tab on the single product page – individually for every product: https://xtemos.com/docs-topic/product-page-options/

    You can find the option to add an extra block on the single page: https://xtemos.com/docs-topic/html-blocks-usage/

    In addition, you can create a custom template for a single product page in Woocommerce builder: https://xtemos.com/docs-cat/woocommerce-layouts-builder/?theme=woodmart

    Best Regards

    #456326

    stvlahos
    Participant

    thank you very much for your reply!

    I know all of these that you have mention !

    I dont want to be as tabs I would like full width, I have my tabs in half width next to product image .

    I would like all the products to have an html block that I will choose in the position of the Extra content
    exactly after the product description.

    So, maybe I can make it with a function or to add the html code in one php file but I do not know which and where it is. to add my code in the position of extra content ! So I need your help !

    I have already migrated all the products of an old woocomerce installation so I can not use product template.

    thank you in advanced.

    #456738

    Hello,

    Please consider using Woocommerce builder: https://xtemos.com/docs-cat/woocommerce-layouts-builder/?theme=woodmart

    You can create a custom template for the single product and insert any content: https://xtemos.com/docs-topic/single-product-page-builder/

    If you have any questions please feel free to contact us.

    Best Regards

    #456749

    stvlahos
    Participant

    I think that you can not understand me .

    I would like in the position where the extra block is located to add an html code/block to all products!!!

    I have more than 500 products! Could someone tell me in which php file is located!
    Or to tell me the right function ?

    with the following code I meet problems. The text is going under the tabs but I would like exactly at position of extra block!

    add_action( ‘woocommerce_single_product_summary’, ‘custom_shortcode’, 40 );

    function custom_shortcode() {
    echo do_shortcode(‘[html_block id="16367"]‘);
    }

    I do not want footer content neither prefooter nor to make new template!
    Do dont tell me again about product layout, builder etc. .

    just one piece of code to all product at the position of extra block

    #457022

    Artem Temos
    Keymaster

    Hello,

    Our extra content has three different positions that use different hooks. Try all of these hooks and see which position suits best to place your custom function with HTML block

    woocommerce_before_single_product
    woodmart_woocommerce_after_sidebar
    woodmart_after_product_content

    Let me know if it helps.

    Kind Regards

    #457049

    stvlahos
    Participant

    Ok
    both of them are working. .

    woocommerce_before_single_product

    woodmart_after_product_content

    Thank you so much! .

    #457054

    Artem Temos
    Keymaster

    Great, you are welcome! Feel free to contact us if you have any further questions.

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Add the same extra block in all products code…’ is closed to new replies.