ossy Posted May 2, 2013 Share Posted May 2, 2013 (edited) Hello, when the program of loyalty or refferal generate a voucher of fixed amount, they do not include the tax and I need to including the tax. I can do it manually from the back office, but I can not be aware at every moment of this. I would need these discount codes will be generated default with the tax included. Thanks. Edited May 2, 2013 by ossy (see edit history) Link to comment Share on other sites More sharing options...
ossy Posted May 2, 2013 Author Share Posted May 2, 2013 Solved: Go to /httpdocs/"admin"/themes/default/template/controllers/cart_rules/actions.tpl Find this: And put like this: Put down line up, it change de orde in the drop-down list and put as default tax included. Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2013 Share Posted May 2, 2013 thanks for sharing the solution im convinced that it will be helpfull for other forum members regards Link to comment Share on other sites More sharing options...
ossy Posted May 2, 2013 Author Share Posted May 2, 2013 Sorry,is not solved, the codes are still generating with tax excluded The option 0 or 1 must come from the referral or loyalty module :( Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2013 Share Posted May 2, 2013 ok, so what prestashop version you use? Link to comment Share on other sites More sharing options...
ossy Posted May 2, 2013 Author Share Posted May 2, 2013 1.5.4.0 in my version Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2013 Share Posted May 2, 2013 modules/loyality/controllers/front/default.php search the: $cart_rule = new CartRule(); $cart_rule->code = $voucher_code; $cart_rule->id_customer = (int)$this->context->customer->id; $cart_rule->reduction_currency = (int)$this->context->currency->id; $cart_rule->reduction_amount = LoyaltyModule::getVoucherValue((int)$customer_points); $cart_rule->quantity = 1; $cart_rule->quantity_per_user = 1; and add the: $cart_rule->reduction_tax = 1; 1 - means tax included 0 - means tax excluded do the same for modules/loyality/loyality-program.php 1 Link to comment Share on other sites More sharing options...
ossy Posted May 2, 2013 Author Share Posted May 2, 2013 And the same for referral module??? Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2013 Share Posted May 2, 2013 And the same for referral module??? exactly, let me know if it helps Link to comment Share on other sites More sharing options...
ossy Posted May 2, 2013 Author Share Posted May 2, 2013 For loyalty module is all ok, but I can not find the files for the referral module. Must have another name. Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2013 Share Posted May 2, 2013 modules/refferalprogram/refferalprogrammodule.php $cartRule->quantity = 1; $cartRule->quantity_per_user = 1; $cartRule->date_from = date('Y-m-d H:i:s', time()); $cartRule->date_to = date('Y-m-d H:i:s', time() + 31536000); // + 1 year $cartRule->code = $this->getDiscountPrefix().Tools::passwdGen(6); $cartRule->name = Configuration::getInt('REFERRAL_DISCOUNT_DESCRIPTION'); $cartRule->id_customer = (int)$id_customer; $cartRule->reduction_currency = (int)$id_currency; Link to comment Share on other sites More sharing options...
ossy Posted May 2, 2013 Author Share Posted May 2, 2013 Hello vekia, in referral module continues add tax when i use the discount code. In loyalty module i change 2 files but in referrals module i change only one file it is ok???? Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2013 Share Posted May 2, 2013 yup, thats correct test it and let me know if it works :-) Link to comment Share on other sites More sharing options...
ossy Posted May 2, 2013 Author Share Posted May 2, 2013 In referral module don´t work, it continue adding tax Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2013 Share Posted May 2, 2013 can you show the code you added to the referralprogrammodule.php ? (lines with $cartRule-> ... ) Link to comment Share on other sites More sharing options...
ossy Posted May 2, 2013 Author Share Posted May 2, 2013 Ok ok I added this $cart_rule->reduction_tax = 1; And the correct way is this $cartRule->reduction_tax = 1; It´s ok?? Link to comment Share on other sites More sharing options...
ossy Posted May 2, 2013 Author Share Posted May 2, 2013 Solved Thakyou very very very much Vekia. :D :D 1 Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2013 Share Posted May 2, 2013 You're welcome :-) im so glad that it works now. I will write tutorial for this on my website because in my opinion it is important to have got an ability to change tax included / excluded for voucher codes Link to comment Share on other sites More sharing options...
ossy Posted May 2, 2013 Author Share Posted May 2, 2013 Is very important, yes Thanks. Link to comment Share on other sites More sharing options...
ossy Posted May 3, 2013 Author Share Posted May 3, 2013 One extra thing, to make the voucher works once, add this line in loyalty module files: $cart_rule->partial_use = 0; Thanks. Link to comment Share on other sites More sharing options...
kelvz Posted August 8, 2013 Share Posted August 8, 2013 Hi! i have a problem in using voucher... i have price rules about free shipping if the total items is greater than 2000 (peso). but... if i apply my voucher worth 200 my shipping fee was applied 2100 - 200 (Total Items - Total voucher) = 1900 my problem is i want to apply shipping if total items is less that 2000 Item1 = 1800 Item2 = 300 voucher = -200 Total Items = 2100 Total voucher = -200 Total shipping = 150 Total amount to be paid = 2050 I want to look like this... Item1 = 1800 Item2 = 300 voucher = -200 Total Items = 2100 Total voucher = -200 Total shipping = 0 Total amount to be paid = 1900 Thanks! Link to comment Share on other sites More sharing options...
kelvz Posted August 8, 2013 Share Posted August 8, 2013 in short.. i want to apply discounts to total amount to be paid NOT in total items... Link to comment Share on other sites More sharing options...
Makina_AMX Posted March 10, 2016 Share Posted March 10, 2016 (edited) Hello, Prestashop 1.6.0.9 I want a minimal amount order of 50€ tax included, but by defaut le voucher is created with a minimal amount of 50€ tax excluded. How is it possible to set it automatically with tax included ? I'm checking this forum all the day, no answer. In modules/loyalty/loyalty-program.php I tried to insert this code but it doesn't work : $cartRule->minumum_amount_tax = 1; /* Voucher creation and affectation to the customer */ $cartRule = new CartRule(); $cartRule->code = $voucherCode; $cartRule->id_customer = (int)$context->customer->id; $cartRule->id_currency = (int)$context->currency->id; $cartRule->reduction_amount = LoyaltyModule::getVoucherValue((int)$customerPoints); $cartRule->quantity = 1; $cartRule->quantity_per_user = 1; $cartRule->reduction_tax = (bool)Configuration::get('PS_LOYALTY_TAX'); $cartRule->minumum_amount_tax = 1; Edited March 10, 2016 by Makina_AMX (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts