Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #3659403
Custom content in single product page
Closed

Comments

  • sourav started the conversation

    Hi , is it possible to add some custom data some text with a link on the single product page for a specific product or  category.

    I have attached an image below that indicates the place where i would like to add the custom text.

    I want to add it just before the product description area

  • sourav replied

    Sorry , I forgot to attach the image in the previous message , i have attached it here

    Attached files:  custom content.png

  •  2,609
    PenciDesign replied

    Hi,

    You should paste this code into the function.php of the child theme or via the CodeSnippet plugin here: https://wordpress.org/plugins/code-snippets/

    add_action( 'woocommerce_single_product_summary', function(){
        ?>
        add your content at this area
        <?php
    }, 45 );

    Regards,
    PenciDesign.



  • sourav replied

    I did but its not showing anything 


  •  2,609
    PenciDesign replied

    Hi,

    Please modify this content:

    add_action( 'woocommerce_single_product_summary', function(){
        ?>
        add your content at this area
        <?php
    }, 30 );

    Regards,
    PenciDesign.


  • sourav replied

    How can i add the text for a specific product or category and also include links in it

  •  2,609
    PenciDesign replied

    Hi,

    To modify the code as per your request, you need to have knowledge about WordPress code.

    Let's check this topic: https://stackoverflow.com/questions/47330471/add-custom-content-for-a-specific-product-on-woocommerce-single-product-pages

    Regards,
    PenciDesign.


  • sourav replied

    Ok , but i need to move the position of the content , I want the content to appear just before the start of the the description.

    I have attached an image below for better understand of the content position.

    Attached files:  custom content 2.png

  •  2,609
    PenciDesign replied

    Hi,

    If you want to modify the content position, please change the number "30" to "50".

    add_action( 'woocommerce_single_product_summary', function(){
        ?>
        add your content at this area
        <?php
    }, 50 ); // change position at this line


    Regards,
    PenciDesign.