Jump to content

Archived

This topic is now archived and is closed to further replies.

kevinsaptel

Need some help to Create a WooCommerce discount Cart

Recommended Posts

kevinsaptel

I have almost completed the initial steps to create a WooCommerce discount cart following several tutorials and forums including 

https://stackoverflow.com/questions/27165576/how-to-add-discount-to-cart-total

https://www.cloudways.com/blog/woocommerce-discount-cart/

 

I want to know that this code gives me a total price with discount as well ? The code is giving me error and i don't know where i am wrong. Need help to rectify this code.

 

  if ( $cw_discount > 0 ) {
        echo '<tr class="cart-discount">
    <th>. __( 'Secure', `woocommerce`) .'</th>
    <td data-title=" '. __( 'Secure', 'woocommerce' ) .' ">'
            . wc_price( $cw_discount + $woocommerce->cart->discount_cart ) .'</td>
    </tr>';

Share this post


Link to post
Share on other sites

×