• Resolved Tim Burkart

    (@bigmoxy)


    Hi,
    My client wants a custom banner to be displayed on the product page in between the product thumbnails and product description / reviews / etc tabs. The banner will be the same for all products.

    How can I accomplish that?

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @bigmoxy

    here is hooks for more idea. you need to add custom function in your active child theme.

     THE HOOK NAME:  woocommerce_single_product_summary hook.  
     THE TEMPLATES HOOKED (+priority order number)  => corresponding template file name:    
    — woocommerce_template_single_title       (5) => single-product/title.php
    — woocommerce_template_single_rating     (10) => single-product/rating.php
    — woocommerce_template_single_price      (10) => single-product/price.php
    — woocommerce_template_single_excerpt    (20) => single-product/short-description.php
    — woocommerce_template_single_add_to_cart(30) => single-product/add-to-cart/ (6 files depending on product type)
    — woocommerce_template_single_meta       (40) => single-product/review-meta.php
    — woocommerce_template_single_sharing -  (50) => single-product/share.php

    Example using add_action() WordPress function:

    // define the woocommerce_single_product_summary callback function

    function my_custom_action() { 
        echo '<p>Banner image goes to here</p>';
    };     
    add_action( 'woocommerce_single_product_summary', 'my_custom_action', 15 ); 

    This function has a priority number of 15 and will display “This is my custom action function” string text, between the product price and the product short description…
    So you can change your priority number as per requirements.`

    Thanks
    Ahir Hemant

    • This reply was modified 3 years, 4 months ago by Ahir Hemant.
    Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    @hemant-ahir thank you for a complete answer ??.

    Kind regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Product page customization’ is closed to new replies.