Okay
  Public Ticket #2015634
Trouble Finding PHP file for single product page
Closed

Comments

  •  1
    humbada started the conversation

    Hi, 

    I'm looking at adding some php code to my product page. I'm looking at embedding a widget below the 'Add to cart' button (see attached image). However, I can't find the file in theme editor to do this. Where is it located and what is it called?

    Thank you in advance, 

    Phil

  • [deleted] replied

    Hi Phil,

    Single product page is constructed in multiple templates, each of them containing different section and each section containing different content. So based on your screenshot if you want to add something below the "Add to Cart" button you can simply do it with this custom PHP code:

    function my_widget_on_single_product_page() {
        // You custom code here
    }
    add_action( 'woocommerce_single_product_summary', 'my_widget_on_single_product_page', 60 );
    I hope this will help you.

  •  1
    humbada replied

    Thank you Arlind for the prompt reply. My issue has been solved! 

  • [deleted] replied

    Dear Phil,

    I am glad that this issue is solved on your side. Will close this ticket now, and if you have further questions feel free to create another ticket.