eGzyl.pl Posted March 2, 2010 Share Posted March 2, 2010 exist module who give my discount of total price ?? Link to comment Share on other sites More sharing options...
olea Posted March 2, 2010 Share Posted March 2, 2010 exist module who give my discount of total price ?? What do you mean ?Which criteria to apply the discount ?Why not using the vouchers ? Link to comment Share on other sites More sharing options...
eGzyl.pl Posted March 2, 2010 Author Share Posted March 2, 2010 that if buy for 100$ i can give -10% of total price if buy for 200$ i can give -15% of total pricevouchers isnt resolve my problem i think Link to comment Share on other sites More sharing options...
Anão de Jardim Posted March 17, 2010 Share Posted March 17, 2010 modify the file: /classes/cart.phpline 663 in version 1.3.0 and 631 in version 1.2.5change: if ($type == 5) return $shipping_fees; if ($type == 6) return $wrapping_fees; if ($type == 3) $order_total += $shipping_fees + $wrapping_fees; if ($order_total < 0 AND $type != 2) return 0; for: if ($order_total >= 100 AND $order_total < 200) $order_total *= 95/100; /* For a purchase between 100 and 200, 5% discount */ if ($order_total >= 200 AND $order_total < 400) $order_total *= 10/100; /* For a purchase between 200 and 400, 10% discount */ if ($order_total >= 400) $order_total *= 85/100; /*Over 400, 15% discount */ if ($type == 5) return $shipping_fees; if ($type == 6) return $wrapping_fees; if ($type == 3) $order_total += $shipping_fees + $wrapping_fees; if ($order_total < 0 AND $type != 2) return 0; ;-) 1 Link to comment Share on other sites More sharing options...
tomitos Posted April 2, 2010 Share Posted April 2, 2010 Thanks Anão de Jardim,your solution is simple and looks that it works. I do have additional quastion:Is it possible to do similar (giving discount on total) but based on number of total items in cart.Like: - buy 2 items from our shop (can be different) and you will get 5 % discount on total price; - buy 3 items from our shop (can be different) and you will get 10 % discount on total price If anyone would know a solution please let us know. Tomaz. Link to comment Share on other sites More sharing options...
curye Posted April 3, 2010 Share Posted April 3, 2010 Works like a charm! Anyway to show first the undiscounted price then slash it and show the discounted price. Link to comment Share on other sites More sharing options...
aquamarine Posted April 14, 2010 Share Posted April 14, 2010 I have 3 criterias I would like to resolve for a discount. Maybe the voucher system would work if I can do the following1. The customer has to live outside of USA and it's territories2. The customer has to spend $100.00 or above.3. If he/she meets the two above criterias, they will get 25% discount off of SHIPPING.How can I work something like that into my shop?Thank you! Link to comment Share on other sites More sharing options...
Lee Posted August 28, 2010 Share Posted August 28, 2010 thanks Anão de Jardim for this code! it appears to work perfectly*We wanted to offer 3 products for a specific price, and this allows you to add a percentage discount to orders between a certain value. You can just work out the percentage discount and then add that to the code. Works well if all your products are the same price.It would be good if there was any way to add additional text to the "total products" display of the cart summary once the discount has been applied - Anyone have any suggestions if this is possible? This contribution also carries the discounts over to Paypal, the Better Together module currently doesn't do this, or even work properly it seems, didn't work for us anyway.*UPDATE - SORRY - THIS CODE DOESN'T PASS THE DISCOUNT ONTO PAYPAL Link to comment Share on other sites More sharing options...
Jero Posted September 3, 2010 Share Posted September 3, 2010 It would be good if there was any way to add additional text to the "total products" display of the cart summary once the discount has been applied - Anyone have any suggestions if this is possible? I have same issue. Is there any way to implement this? Link to comment Share on other sites More sharing options...
Timpet Posted September 3, 2010 Share Posted September 3, 2010 This change will give the discount on the same amount allways, allso when changing Currencies?A fix / change that added a voucher / discount instead would be nice. This would allso allow users to know why the sum of the cart is different that what the calculated.Nice work anyways 1 Link to comment Share on other sites More sharing options...
Timpet Posted September 26, 2010 Share Posted September 26, 2010 Im still on the look for a module / change that allows the user a discount on the totalorder above X, but somehow adds a discount to the cart instead of just changing the ordertotal. Users might find this confuseing and leave!?I was think about a version where a voucher is avalible for users, to use when ordertotal comes above x. But there are issue's to this:- (voucher set to 1 use pr costumer) 2. time user want to add to the cart and get the discount it fails.- (voucher can be used many time pr costumer) the user adds the same voucher 10 times and gets way to much discount! Link to comment Share on other sites More sharing options...
erikl Posted September 30, 2010 Share Posted September 30, 2010 Hi!Is there any way to add exceptions?Like if I have a product on sale that cost 1200 and I don't want to apply a discount to that but to the other smaller products I do...Thx Link to comment Share on other sites More sharing options...
geronimo Posted November 2, 2010 Share Posted November 2, 2010 Is the Prestashop always using Euros internally? Link to comment Share on other sites More sharing options...
Bogdan2011 Posted March 3, 2011 Share Posted March 3, 2011 If i change the code, function perfectly, the total is changing how i put in cart.php....but i wanna show on shopping cart the total of discount ....not only the total discounted .......customers must see the discount.Maybe u find it solution ...and maybe u can help me .. Link to comment Share on other sites More sharing options...
Alligiftor Posted April 11, 2011 Share Posted April 11, 2011 Hi i put code like this in my cart.phpif ($order_total >= 50 AND $order_total < 100) $order_total *= 95/100; /* For a purchase between 50 and 100, 5% discount */ f ($order_total >= 101 AND $order_total < 1000) $order_total *= 10/100; /* For a purchase between 101 and 1000, 10% discount */ if ($type == 5) return $shipping_fees;if ($type == 6) return $wrapping_fees;if ($type == 3) $order_total += $shipping_fees + $wrapping_fees;if ($order_total < 0 AND $type != 2) return 0;then i did a test order which normally would of come to £54 but when i clicked on cart it is coming up at total of £7.90 how is this happening?I want it so that orders between £50 - £100 get 5% offan orders between £101- and £1000 get 10% offcan you help with coding please? Link to comment Share on other sites More sharing options...
Bogdan2011 Posted April 11, 2011 Share Posted April 11, 2011 Correct code is : if ($order_total >= 50 AND $order_total < 100) $order_total = 95/100; / For a purchase between 50 and 100, 5% discount */f ($order_total >= 101 AND $order_total < 1000) $order_total = 90/100; / For a purchase between 101 and 1000, 10% discount */if ($type 5) return $shipping_fees; if ($type 6) return $wrapping_fees;if ($type == 3) $order_total += $shipping_fees + $wrapping_fees;if ($order_total < 0 AND $type != 2) return 0; Link to comment Share on other sites More sharing options...
Bogdan2011 Posted April 11, 2011 Share Posted April 11, 2011 95/100 for 5%90/100 for 10%85/100 for 15%...50/100 for 50%etc.... Have a nice day !! Link to comment Share on other sites More sharing options...
Alligiftor Posted April 11, 2011 Share Posted April 11, 2011 Correct code is : if ($order_total >= 50 AND $order_total < 100) $order_total = 95/100; / For a purchase between 50 and 100, 5% discount */f ($order_total >= 101 AND $order_total < 1000) $order_total = 90/100; / For a purchase between 101 and 1000, 10% discount */if ($type 5) return $shipping_fees; if ($type 6) return $wrapping_fees;if ($type == 3) $order_total += $shipping_fees + $wrapping_fees;if ($order_total < 0 AND $type != 2) return 0; Just copied and pasted this code and it crashed website, was getting message say server error 500.good job i backed up original file Link to comment Share on other sites More sharing options...
Bogdan2011 Posted April 11, 2011 Share Posted April 11, 2011 Hey ,Put 90/100 instead 10/100 in your code ...for 10% discount !!! Link to comment Share on other sites More sharing options...
Bogdan2011 Posted April 11, 2011 Share Posted April 11, 2011 Sorry for first message ...i copied from ur post ...and u missed an "i" from "f ($order_total >= 101" .... that why u get that error Link to comment Share on other sites More sharing options...
Alligiftor Posted April 11, 2011 Share Posted April 11, 2011 Added the "i" in and it still comes back with a server error Link to comment Share on other sites More sharing options...
j0nnymoe Posted June 25, 2011 Share Posted June 25, 2011 Hey, This is just what Im looking for, How do I go about adding this is version v1.4?Thanks Link to comment Share on other sites More sharing options...
miss-d Posted July 20, 2011 Share Posted July 20, 2011 Hi and thanks for this solution, works like a charm - I'm looking for a way to add a message that - if you have a reached the discoutn amount of 500,- € in my case - there should be a message in the shopping cart / shopping cart template that customers can actually see that they have a discount. Otherwise it just reduces the total amount and everybody is wondering why he/she is paying less Where do I have to change what? shopping-cart.tpl? cart.php? Any help is highly appreciated Thx. Link to comment Share on other sites More sharing options...
miss-d Posted August 17, 2011 Share Posted August 17, 2011 Hi and thanks for this solution, works like a charm - I'm looking for a way to add a message that - if you have a reached the discoutn amount of 500,- € in my case - there should be a message in the shopping cart / shopping cart template that customers can actually see that they have a discount. Otherwise it just reduces the total amount and everybody is wondering why he/she is paying less <br/><br/>Where do I have to change what? shopping-cart.tpl? cart.php? <br/><br/>Any help is highly appreciated Thx. Anyone can help me on this? Link to comment Share on other sites More sharing options...
Jens Italy Posted September 9, 2011 Share Posted September 9, 2011 How could it be changed to have this type of discount? If a customer orders products for at least 50 euros, he will get an 8 euro discount. possible? Link to comment Share on other sites More sharing options...
salko Posted September 11, 2011 Share Posted September 11, 2011 modify the file: /classes/cart.php line 663 in version 1.3.0 and 631 in version 1.2.5 change: if ($type == 5) return $shipping_fees; if ($type == 6) return $wrapping_fees; if ($type == 3) $order_total += $shipping_fees + $wrapping_fees; if ($order_total < 0 AND $type != 2) return 0; for: if ($order_total >= 100 AND $order_total < 200) $order_total *= 95/100; /* For a purchase between 100 and 200, 5% discount */ if ($order_total >= 200 AND $order_total < 400) $order_total *= 10/100; /* For a purchase between 200 and 400, 10% discount */ if ($order_total >= 400) $order_total *= 85/100; /*Over 400, 15% discount */ if ($type == 5) return $shipping_fees; if ($type == 6) return $wrapping_fees; if ($type == 3) $order_total += $shipping_fees + $wrapping_fees; if ($order_total < 0 AND $type != 2) return 0; ;-) How is this discount visible on invoice? Link to comment Share on other sites More sharing options...
jacky75 Posted September 12, 2011 Share Posted September 12, 2011 Hi all, only to understand.... Why are you trying to edit a core class like "/classes/cart.php"? After each update you'll lose your changes and maybe they could not be applicable to the new release. Since Prestashop gives us to solution to change its behavior, modules and overriding (the last one only from 1.4.x), we should apply those ones. And remember that core classes are protected by a specific license. To make the wished thing in my opinion it should be necessary to write a module handling the "New order" hook. When a new order is posted in the system, a specific voucher is created and added to it. In this way all will works: the back office, the emails sent to the customer, the invoices etc etc.. What do you think? Regards, Jacky75 Link to comment Share on other sites More sharing options...
milausj Posted September 26, 2011 Share Posted September 26, 2011 I need something similar, discount of price, if in product is choose: 1. Fast order +10% 2. Normal (normal price) 3. Slow order -10% This impact on cart block, anche to all choose. I need this choose for every product. Thanks M. Link to comment Share on other sites More sharing options...
andy91 Posted October 19, 2011 Share Posted October 19, 2011 Hi I am using 1.3.1.1, This is an old project and one of our developers implemented this hack to give a discount of 5% for orders between 250 and 500 and 7% between 500 and 1000 and 15% for orders over 1000. The amount taken off the total price is correct but we are displaying the discount amount separately in the cart and this amount is not correct even though the total price shown is! Therefore the discount amount is being altered somewhere else in the code and Iv no idea where? You can see the problem yourself if you go to http://www.easyspacedesign.com/craig/isle-of-bute2/ and add products to cart at a value between 250 and 500. You will see in the cart total price at the top then the discount amount then the Total products (tax incl.). If you take 5% off the total price you will see that Total products (tax incl.) is the correct value however the value shown in the discount amount is approximately 20% less than what it should. Here is the code of our hack: if ($order_total >= 250 AND $order_total < 500){ $order_total2 = 0.95 * $order_total; /* For a purchase between 250 and 500, 5% discount */ $discount_total = $order_total - $order_total2; $order_total = $order_total2; echo $discount_total; } if ($order_total >= 500 AND $order_total < 1000){ $order_total = 0.93 * $order_total; /* For a purchase between 500 and 1000, 7% discount */ $discount_total = 0.07 * $order_total; } if ($order_total >= 1000){ $order_total = 0.85 * $order_total; /* For a purchase over 1000, 15% discount */ $discount_total = 0.15 * $order_total; } if ($type == 5) return $shipping_fees; if ($type == 6) return $wrapping_fees; if ($type == 3) $order_total += $shipping_fees + $wrapping_fees; if ($order_total < 0 AND $type != 2) return 0; if($type==8){ return Tools::ps_round(floatval($discount_total), 2); } return Tools::ps_round(floatval($order_total), 2); The calculations in the above code is correct and I have echo'd out $discount_total; and it shows the correct discount amount yet when it is shown in the cart the amount has been altered. Anybody got any ideas on this? Its driving me nuts. I am an intermediate level php developer but Iv never used prestashop and don't really no how the system works. I have feeling that it has something to do with the smartly template and the VAT being taken off the discount amount but I just cant find where this is happening! Link to comment Share on other sites More sharing options...
kingcheetah Posted November 7, 2011 Share Posted November 7, 2011 Hey, This is just what Im looking for, How do I go about adding this is version v1.4? Thanks For me the same problem. I have version 1.4. The code is different from 1.4 cart.php Can I paste the code mentioned above? If so, where should it be? If not, what is the new code I also searched for modules, but there are no modules for this ''problem''. If more people want this fixed too would still be there? Link to comment Share on other sites More sharing options...
Peyman-green Posted November 8, 2011 Share Posted November 8, 2011 how to show discount amount on cart page ? Link to comment Share on other sites More sharing options...
sng Posted November 28, 2011 Share Posted November 28, 2011 Hi What do i do if i want to double up carrier $shipping_cost when total price is less than or equal 123,00 and if it is greater than or equal 123,01 defined delivery cost. (PS 1.4) Best regards. Link to comment Share on other sites More sharing options...
SONIC PEAN Posted February 4, 2012 Share Posted February 4, 2012 Hi, Could you refer to this module. I think that will be fine with you. http://www.prestashop.com/forums/topic/154110-cart-promotion-buy-x-products-get-discount-and-more/ Thanks Link to comment Share on other sites More sharing options...
mcluca Posted February 6, 2012 Share Posted February 6, 2012 hi how know if there is a simple way to apply discount based on total price only in ps 1.4 like this module? i think to mod quantity discount free module. thks Link to comment Share on other sites More sharing options...
DylzEn Posted November 18, 2012 Share Posted November 18, 2012 Does anyone know how to make this work for PS v1.4.7 and make it also work with Paypal? Thanks for sharing anyway guys. Link to comment Share on other sites More sharing options...
Sadegh940 Posted January 8, 2013 Share Posted January 8, 2013 any solution for v1.4.7 ?? Link to comment Share on other sites More sharing options...
hobylazy Posted February 8, 2013 Share Posted February 8, 2013 I wish to have this module Link to comment Share on other sites More sharing options...
favor911 Posted October 31, 2014 Share Posted October 31, 2014 modify the file: /classes/cart.php line 663 in version 1.3.0 and 631 in version 1.2.5 change: if ($type == 5) return $shipping_fees; if ($type == 6) return $wrapping_fees; if ($type == 3) $order_total += $shipping_fees + $wrapping_fees; if ($order_total < 0 AND $type != 2) return 0; for: if ($order_total >= 100 AND $order_total < 200) $order_total *= 95/100; /* For a purchase between 100 and 200, 5% discount */ if ($order_total >= 200 AND $order_total < 400) $order_total *= 10/100; /* For a purchase between 200 and 400, 10% discount */ if ($order_total >= 400) $order_total *= 85/100; /*Over 400, 15% discount */ if ($type == 5) return $shipping_fees; if ($type == 6) return $wrapping_fees; if ($type == 3) $order_total += $shipping_fees + $wrapping_fees; if ($order_total < 0 AND $type != 2) return 0; ;-) Hi, There Nice job. How can i do same thing on Prestashop 1.4.x ??? Becouse cart.php is different. Thanks, Andrew Link to comment Share on other sites More sharing options...
kirubanidhi Posted August 16, 2017 Share Posted August 16, 2017 (edited) In my front page. There are 3 products available. The first and second product discount value is getting correctly. Third product discount value is wrong. How to resolve this problem. I attached my image url . https://ibb.co/kAr3sF Please give me any idea to resolve this problem. Edited August 16, 2017 by kirubanidhi (see edit history) Link to comment Share on other sites More sharing options...
Spider A.J. Posted July 30, 2019 Share Posted July 30, 2019 (edited) Any idea how to disabling this discount price for products who are allready "on sale"? if ($order_total >= 1000) $order_total = $order_total_discount + (($order_total - $order_total_discount) * 95/100); will no work of course because $order_total_discount does not return the value of all products in the other promotion. In higher versions then 1.4 in classes/CartRule.php there is some code like this: // Do not give a reduction on free products! $order_total = $context->cart->getOrderTotal($use_tax, Cart::ONLY_PRODUCTS, $package_products); foreach ($context->cart->getCartRules(CartRule::FILTER_ACTION_GIFT) as $cart_rule) $order_total -= Tools::ps_round($cart_rule['obj']->getContextualValue($use_tax, $context, CartRule::FILTER_ACTION_G IFT, $package), 2); and there is simple, need to add after this some code like this: foreach ($package_products as $product) // if($product['on_sale']) if (Product::isDiscounted((int)$product['id_product'])) $order_total -= $use_tax ? $product['total_wt'] : $product['total']; The "//" comment coz in lower versions eg, 1.5 there is no declaration 'on_sale' but in 1.4 Cart.php there is no such thing like that To explain idea. I need some variable or function to return allready discounted products in Cart to not give them 5% discounts but calculate them to >=1000 . in 1.4 Cart.php there is some above like this: /* Secondly applying all vouchers to the correct amount */ $shrunk = false; foreach ($discounts AS $discount) if ($discount->id_discount_type != 3) { $order_total -= Tools::ps_round((float)($discount->getValue(sizeof($discounts), $order_total_products, $shipping_fees, $this->id, (int)($withTaxes))), 2); if ($discount->id_discount_type == 2) if (in_array($discount->behavior_not_exhausted, array(1,2))) $shrunk = true; } but im not pretty sure what return: Tools::ps_round((float)($discount->getValue(sizeof($discounts) Anybody help? greedzz SAJ Edited July 30, 2019 by Spider A.J. (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now