• Hello Sir,
    I need some help. Is there any chance to show the discount percentage in Woocommerce Product List (Backend)? I mean how to add an additional admin column in product list, that’ll show the discount percentage? Thanks in advance.

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

    (@riaanknoetze)

    Hi there,

    Can you share a bit more on how that percentage discount is applied? By default, WooCommerce only allows store owners to set a discounted, fixed price on the product setup page.

    Thread Starter Atanu Bhunia

    (@faster123)

    Thanks for your reply. Actually I used some lines of code to my theme’s function.php to show the discount percentage in Frontend of Single Product Page just below of Product Pricing. Below is the code

    function dc_your_discount() {

    global $product;

    if( $product->is_type(‘simple’) || $product->is_type(‘external’) || $product->is_type(‘grouped’) ) {

    $regular_price = get_post_meta( $product->get_id(), ‘_regular_price’, true );
    $sale_price = get_post_meta( $product->get_id(), ‘_sale_price’, true );

    if( !empty($sale_price) ) {

    $amount_saved = $regular_price – $sale_price;
    $currency_symbol = get_woocommerce_currency_symbol();

    $percentage = round( ( ( $regular_price – $sale_price ) / $regular_price ) * 100 );
    ?>
    <p style=”font-size:16px;color:red;”><b>You Save: <?php echo number_format($percentage,0, ”, ”).’%’; ?></b></p>
    <?php
    }
    }
    }

    add_action( ‘woocommerce_single_product_summary’, ‘dc_your_discount’, 11 );

    Thread Starter Atanu Bhunia

    (@faster123)

    Hello,
    Can anyone help me regarding this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How To Show Discount Percentage In Admin Product List’ is closed to new replies.