• Resolved dutt

    (@rajat-dutt)


    Dear woo team
    thanks for creating this amazing plugin I have one query
    https://snipboard.io/RB2EvJ.jpg

    see that aboe picture its on other software is this possible to display the same coupon’s on product page in box by using any plugin or code
    pls guide me in this how can I do that on my website
    nexahair.com

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    The WooCommerce plugin itself doesn’t have any native functions to display the conditions of various coupon codes in the product description area.

    With that said, have you considered manually adding that text in the short description field for the relevant products?

    Thread Starter dutt

    (@rajat-dutt)

    I dont have any condition of coupon. there will be common coupon’s for all the products.
    You know practically its not possible to add copoun detail in short description section for all products and make changes in future.Is there anyway to display common coupon codes on all products?

    Plugin Support abwaita a11n

    (@abwaita)

    Hi @rajat-dutt,

    Thanks for clarifying. Since the coupons will be applicable for all products, then you could consider inserting them in the short description section.

    If you have many products such that it would not be ideal to add/change in each product, you could use an action hook to output the coupon codes in the short description section for your products as explained here: https://stackoverflow.com/questions/49577834/add-text-under-single-product-short-description-in-woocommerce

    Hope this helps.

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there ??

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    Thread Starter dutt

    (@rajat-dutt)

    add_action( ‘woocommerce_single_product_summary’, ‘custom_single_product_summary’, 2 );
    function custom_single_product_summary(){
    global $product;

    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 20 );
    add_action( ‘woocommerce_single_product_summary’, ‘custom_single_excerpt’, 20 );
    }

    function custom_single_excerpt(){
    global $post, $product;

    $short_description = apply_filters( ‘woocommerce_short_description’, $post->post_excerpt );

    if ( ! $short_description )
    return;

    // The custom text
    $custom_text = ‘<ul class=”fancy-bullet-points red”>

    • Current Delivery Times: Pink Equine – 4 – 6 Weeks, all other products 4 Weeks
    • ‘;

      ?>
      <div class=”woocommerce-product-details__short-description”>
      <?php echo $short_description . $custom_text; // WPCS: XSS ok. ?>
      </div>
      <?php
      }

      I tried to add this code in function.php
      but it display nothing./
      can u guide me what to do?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Coupon code on product page’ is closed to new replies.