comprausa Posted March 17, 2012 Share Posted March 17, 2012 The BO doesn't allow negative percent vouchers, Is there a way around this? Link to comment Share on other sites More sharing options...
phrasespot Posted March 19, 2012 Share Posted March 19, 2012 The BO doesn't allow negative percent vouchers, Is there a way around this? What are you trying to do? Increase the cart total by voucher percentage when a voucher is applied to the cart? Link to comment Share on other sites More sharing options...
comprausa Posted March 20, 2012 Author Share Posted March 20, 2012 Yes, increase the cart total by a percentage amount. Link to comment Share on other sites More sharing options...
phrasespot Posted March 20, 2012 Share Posted March 20, 2012 Not tested. Removing 'value' from $fieldsValidate and $webserviceParameters fields of Discount class will allow you to create a negative invoice. How that would work with the arithmetic of voucher calculations, I don't know. Each method where it is used may also need to be modified. Link to comment Share on other sites More sharing options...
comprausa Posted March 21, 2012 Author Share Posted March 21, 2012 But my intention is not to create a negative invoice, but to create a negative discount voucher (in other words to add a fee). Since the voucher will act as a fee, the invoice total will go up not down and never negative. So far I tried using negative % vouchers by editing the discount value directly on the database, and it works perfect at first. It adds a % fee to the order summary, allows selection of payment and shipping but when I click on confirm my order I get this error: (Fatal error (Discount -> value = -12.00) Minus 12 is the value I am using for the negative % discount. I hope this clarifies the issue I am having. Link to comment Share on other sites More sharing options...
phrasespot Posted March 21, 2012 Share Posted March 21, 2012 But my intention is not to create a negative invoice, but to create a negative discount voucherYeah that is what I meant to write, negative voucher. It is a typo. The reason you are getting errors is during voucher creation a check is made on the value of the voucher that it is a positive value. In addition to what you are doing now, if you modify the Voucher class not to check the value field as I described in previous post it may work. Link to comment Share on other sites More sharing options...
comprausa Posted March 21, 2012 Author Share Posted March 21, 2012 It worked! Thanks a lot! For everyone else, I just commented what phrasespot indicated in /classes/Discount.php (PS v1.4.6.2) LINE 94 From: 'name' => 'isDiscountName', 'value' => 'isPrice', 'quantity' => 'isUnsignedInt', 'quantity_per_user' => 'isUnsignedInt', To: 'name' => 'isDiscountName', /*'value' => 'isPrice', */'quantity' => 'isUnsignedInt', 'quantity_per_user' => 'isUnsignedInt', LINE 112 From: 'value' => array('sqlId' => 'value'), To: //'value' => array('sqlId' => 'value'), Link to comment Share on other sites More sharing options...
yohio Posted June 17, 2012 Share Posted June 17, 2012 Hi there, I've followed what you both did and it worked, I get the extra fee on the checkout page (order summery page) but once the invoice is made it shows the amount that was added on the order summery page as a discount and removes the same amount from the initial amount (before the added fee). an example: order summery-> price = 3000 (before voucher was added) price = 3105 (after voucher was added) Invoice-> price = 3000 before "discount" price = 2895 after "discount" My question is how to fix the amount on the invoice itself so it shows the same price as the order summary page. and also how to change the word "discount" to something else like "discount / aditional fees" Thanks. Yohai A. www.buildweb.co.il Link to comment Share on other sites More sharing options...
vcopola Posted May 20, 2014 Share Posted May 20, 2014 solution for version 1.5? 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