Home › Forums › WoodMart support forum › Add the same extra block in all products code…
Add the same extra block in all products code…
- This topic has 7 replies, 3 voices, and was last updated 1 year, 9 months ago by Artem Temos.
-
AuthorPosts
-
April 1, 2023 at 2:29 pm #456234
stvlahosParticipantI 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 !
April 2, 2023 at 2:13 am #456318
Elise NoromitMemberHello,
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
April 2, 2023 at 2:54 am #456326
stvlahosParticipantthank 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.
April 3, 2023 at 3:56 pm #456738
Elise NoromitMemberHello,
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
April 3, 2023 at 4:05 pm #456749
stvlahosParticipantI 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
April 4, 2023 at 12:05 pm #457022
Artem TemosKeymasterHello,
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
April 4, 2023 at 12:40 pm #457049
stvlahosParticipantOk
both of them are working. .woocommerce_before_single_product
woodmart_after_product_content
Thank you so much! .
April 4, 2023 at 12:54 pm #457054
Artem TemosKeymasterGreat, you are welcome! Feel free to contact us if you have any further questions.
-
AuthorPosts
The topic ‘Add the same extra block in all products code…’ is closed to new replies.
- You must be logged in to create new topics. Login / Register