VIXUS Posted December 4, 2009 Share Posted December 4, 2009 I need help on this one...Does anyone know how can i make one specific voucher that will increase total sum by certain percentage? Link to comment Share on other sites More sharing options...
VIXUS Posted December 4, 2009 Author Share Posted December 4, 2009 Nobody knows?Is this even possible? Link to comment Share on other sites More sharing options...
rocky Posted December 5, 2009 Share Posted December 5, 2009 I tried adding a voucher with a negative value and it wouldn't let me save it, so I would say that it is not possible using the Back Office. You could try modifying classes/Cart.php and change lines 628-631 from: /* Secondly applying all vouchers to the correct amount */ foreach ($discounts AS $discount) if ($discount->id_discount_type != 3) $order_total -= floatval($discount->getValue(sizeof($discounts), $order_total_products, $shipping_fees, $this->id, intval($withTaxes))); to: /* Secondly applying all vouchers to the correct amount */ foreach ($discounts AS $discount) if ($discount->id_discount_type != 3) { if ($discount->id == 1) $order_total += floatval($discount->getValue(sizeof($discounts), $order_total_products, $shipping_fees, $this->id, intval($withTaxes))); else $order_total -= floatval($discount->getValue(sizeof($discounts), $order_total_products, $shipping_fees, $this->id, intval($withTaxes))); } where 1 is the id of the voucher you want to be added instead of subtracted. Link to comment Share on other sites More sharing options...
VIXUS Posted December 5, 2009 Author Share Posted December 5, 2009 Thanx ill try that! Link to comment Share on other sites More sharing options...
VIXUS Posted December 10, 2009 Author Share Posted December 10, 2009 Darn!!! :shut: I am on 1.1 and it does not work for me...this is sample of code that i made, it starts from 595 line: /* Secondly applying all vouchers to the correct amount */ foreach ($discounts AS $discount) if ($discount->id_discount_type != 3) { if ($discount->id == 1) $order_total += floatval($discount->getValue(sizeof($discounts), $order_total_products, $shipping_fees, $this->id)); else $order_total -= floatval($discount->getValue(sizeof($discounts), $order_total_products, $shipping_fees, $this->id)); } } 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; return $order_total; } As soon as i made this change front office dont work at all... HTTP 500 internal server error appearsCan you help me? Link to comment Share on other sites More sharing options...
VIXUS Posted December 11, 2009 Author Share Posted December 11, 2009 Can someone help me with this?...is this possible to create? Link to comment Share on other sites More sharing options...
rocky Posted December 12, 2009 Share Posted December 12, 2009 That's odd. I just tested this code on my v1.2.5 installation and it worked fine. I don't understand why it would cause an error on your front office. Link to comment Share on other sites More sharing options...
VIXUS Posted December 12, 2009 Author Share Posted December 12, 2009 Wow, it works... i had one "{" too much.Can you help me how to fix price display in cart, becouse vaucher ammount is displayed with prefix symbol " - " (like -1.250,00) even do i acutaly am suming those values? Link to comment Share on other sites More sharing options...
rocky Posted December 13, 2009 Share Posted December 13, 2009 You'll need to change lines 187-188 of shopping-cart.tpl in your theme's directory to: {if !$priceDisplay || $priceDisplay == 2}{if $discount.id_discount == 1}{convertPrice price=$discount.value_real}{else}{convertPrice price=$discount.value_real*-1}{/if}{if $priceDisplay == 2} {l s='+Tx'} {/if}{/if} {if $priceDisplay}{if $discount.id_discount == 1}{convertPrice price=$discount.value_tax_exc}{else}{convertPrice price=$discount.value_tax_exc*-1}{/if}{if $priceDisplay == 2} {l s='-Tx'}{/if}{/if} and line 82 of modules/blockcart/blockcart.tpl to: {if $discount.id_discount != 1}-{/if}{if $priceDisplay == 1}{convertPrice price=$discount.value_tax_exc}{else}{convertPrice price=$discount.value_real}{/if} and line 321 of modules/blockcart/ajax-cart.js to: $('#bloc_cart_voucher_' + this.id + ' td.price').text(this.id == 1 ? abs(this.price) : this.price); Link to comment Share on other sites More sharing options...
VIXUS Posted December 13, 2009 Author Share Posted December 13, 2009 Excellent mate!! You are a lifesaver!!!THANX! Link to comment Share on other sites More sharing options...
BeeR Posted March 16, 2011 Share Posted March 16, 2011 Hello (sorry for my English)I have the same problem with negative amount in cart. When all price products gets over a free shipping price, it shows amount with "-".How can i mak that stops on "0" or show something like "Free shipping is yours"?Here you can see it: http://abacus.vizz.pl/tmp/screen.png Link to comment Share on other sites More sharing options...
comprausa Posted March 17, 2012 Share Posted March 17, 2012 I am trying to do the samebut instead of negative amount my voucher is negative %. I added a negative % voucher by editing the discount value directly on the database, and it works perfect at first. But when I confirm the order I get this error: (Fatal error (Discount -> value = -12.00) Any ideas? thanks. ------------------- Solved here http://www.prestashop.com/forums/topic/160725-negative-percentage-voucher-for-fee/ Link to comment Share on other sites More sharing options...
Recommended Posts