WooCommerce Custom Item in Single Product Page

This topic has 4 replies, 2 voices, and was last updated 5 months ago ago by Tony Rodriguez

  • Avatar: Francesco
    Francesco
    Participant
    December 1, 2023 at 17:36

    Dear support,
    I’m trying to add custom item into the Single Product Page of woocommerce.
    I activated the XStore Child Theme and I added into functions.php:

    add_action('woocommerce_before_single_product_summary',function(){
    	printf('<h4><a href="?added-content">Congratulations, you\'ve just added a link!</a></h4>');
      }
      );

    But viewing the website it doesn’t show the new custom item.
    Have you a suggestion why?
    I imported the Demo Content “Future Energy”.

    Regards
    Francesco

    3 Answers
    Avatar: Tony Rodriguez
    Tony Rodriguez
    Support staff
    December 2, 2023 at 08:04

    Hello, @Francesco,

    Thank you for reaching out to us.

    We would like to inform you that our theme support policy does not cover assistance with custom code. However, we understand the importance of your query and have made an exception to assist you.

    As you are utilizing the single product builder on your website, the default hook may not function as expected. To address this, our development team has crafted a custom code snippet for your use:

    add_action('etheme_after_single_product_image', function() {
        printf('Congratulations, you\'ve just added a link!');
    });

    We kindly ask that you implement this code in place of your current one. Subsequently, you will be able to add HTML blocks to the single product template as desired.

    For your reference, here is an example of how it should appear: https://postimg.cc/ygRTmxk8

    Should you require any further assistance, please do not hesitate to contact us.

    Warm regards,
    The 8Theme Team

    Avatar: Francesco
    Francesco
    Participant
    December 6, 2023 at 11:11

    Dear Support,
    thank you for the reply.
    I have some other additional questions:

    – I installed the “Future Energy” XStore Demo template and I see (clickong on XStore Builder) that there is a “Single Product” and “Single Product (old)” item. What is mean? In the Single Product (old) I can Edit the page, but on “Single Product” I need to create a new one strarting from some templates. How can I switch from the OLD and the new “Singl Product” builder page template created?

    – How can I disable the Elementor Single product builder and use a standard woocommercer Single Product page/template? Just to have the possibility to use the community as informations source to modify the page code?

    – I’ve seen the code that you shared with me, but it is a sort of enable code to permit me to add custom html code in the page? Beacause I added your code to my Theme childer functions.php and i don’t see anything.

    Thanks and Regards
    Francesco

    Avatar: Tony Rodriguez
    Tony Rodriguez
    Support staff
    December 6, 2023 at 13:27

    Hello, @Francesco,

    1. We would like to inform you that the legacy Single Product Builder is accessible via the following navigation path: Xstore >> Theme Options >> WooCommerce >> Single Product Builder.

    Conversely, we are pleased to announce the introduction of our New Single Product Builder, which has been included in our most recent updates. This innovative feature allows you to design a custom layout for the single product page using the Elementor page builder within our updated Single Product Builder. For detailed guidance, please consult our theme documentation at the following link: https://xstore.helpscoutdocs.com/article/190-xstore-single-product-builder-with-elementor

    2. If you do not want to use the new single product builder then simply leave it and you can create your single product page custom layout using the old builder of the single product page/

    Should you require any further assistance, please do not hesitate to reach out.

    Warm regards,
    The 8Theme Team

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.