Jump to content

Price discount percentage in cart


Recommended Posts

Hi,

 

i have trouble with the prices discount percentage in the cart.

 

When percentage discount is setted to (for example) 45%, in the item page i can see the start price, the percentage and the discounted price in the right way, but when i check the cart berfore continuing the checkout, the START PRICE and the DISCOUNTED PRICE are right, but the DISCOUNT PERCENTAGE is totally wrong.

 

Obviously checking the same product.

 

The first image is the discount on the product page, the second one, on the cart page (same item).

post-710736-0-76672200-1398353096_thumb.png

post-710736-0-60808400-1398353119_thumb.png

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Maybe your shop show "prices tax excluded"? (if prices are tax included, discount is OK ;) )

 

If you are a  "prices tax excluded" merchant, please, check these files out:

 

1.- <your_theme>/shopping-cart-product-line.tpl

 

Circa line 49, you will find

 

{assign var='priceReductonPercent' value=(($product.price_without_specific_price - $product.price_wt)/$product.price_without_specific_price) * 100 * -1}

 

Change with:

 

{assign var='priceReductonPercent' value=(($product.price_without_specific_price - $product.price)/$product.price_without_specific_price) * 100 * -1}

 

2.- <your_theme>/js/cart-summary.js 

 

Circa line 751, you will find

 

priceReductionPercent = ps_round((ps_round(product_list.price_without_quantity_discount) - ps_round(product_list.price_wt))/ps_round(product_list.price_without_quantity_discount) * -100); 

 

Change with:

 

priceReductionPercent = ps_round((ps_round(product_list.price_without_quantity_discount) - ps_round(product_list.price))/ps_round(product_list.price_without_quantity_discount) * -100);

 

 

I think this hack solves both tax included and tax excluded scenarios, but not 100% sure.

 

 

Happy PrestaShopping 2 all

  • Like 1
Link to comment
Share on other sites

Getting back to this , i have tried it and almost satisfied.

 

my problem is I have 2 different percentages for the same product depending on how i use my browser.

 

Explain: product price 0.70€ / pieces. at 300 the price goes 25%)

 

if i change the quantity manually using keypad or using the plus minus signs   i get - 24.69% if i refresh the page i get -24%

 

i have also noticed that if i force the price instead of using a percentage then using plus minus or manual entry  wont show the percentage either untill i refresh

 

thanks.

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

hi,

until prestashop do not give up a patch , one solution for this issue is to do not display this % in the cart

 

in global.css

 

line 7031 : replace "inline-block" by "none"

 

  #cart_summary tbody td.cart_unit .price span.price-percent-reduction {
    margin: 5px auto;
       display: none;
 /*   display: inline-block;*/ }

 

 

To have only the final price you could also do it for "old-price"  and insert display none

 

like this line 7035 :

  #cart_summary tbody td.cart_unit .price span.old-price {
      display: none;
    text-decoration: line-through; }

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

I did the fix from #6 but after clicking on plus to increase qty it would show 5.14% instead of 5% so I rewrote line 751 like this seems to work (I think I got rid of rounding (ps_round) )

priceReductionPercent = (product_list[i].price_without_quantity_discount - product_list[i].price)/product_list[i].price_without_quantity_discount * -100);
		
Link to comment
Share on other sites

  • 1 month later...

 

Hi, I need to generate an estimated quantity discount, for example if I buy 3 products about 25% is applied to any product 
 
use would be helpful prestashop 1.6

 

 

You can not setup your discount as your required  if I buy 3 products about 25% is applied to any product ) by using standard Prestashop feature.

 

Here what SOO Prestashop Discount can do : 

  • FILTERED either in the attribution criteria or in the commutation: by category, by suppliers, by manufacturers, by products with discounts, by products with quantity price rules…
  • SETUP ORDER AMOUNT thresholds with or without taxes, all discount percentages and all currency discounts.
  • CUSTOMIZE YOUR PROMOTION RULES in so many different ways, easy to get lost in the different amazing capabilities of the SOO Prestashop Discount module but once integrated in your backend.
Edited by DeJour (see edit history)
Link to comment
Share on other sites

  • 1 month later...
×
×
  • Create New...