[vQmod] Apply coupon during checkout
Re: [vQmod] Apply coupon during checkout
uksitebuilder wrote:Just tested with free shipping and instead of an item_x and amount_x
I just get a <input name="discount_amount_cart" value="0.50"> (which was the amount of discount)
When at PayPal it shows as an item 'Discount' but deducts from the totals correctly.
So looks like there are two ways of sending over the discount to paypal
1. if you have shipping, OC deducts the discount from the shipping and sets item_x and amount_x
2. if free shipping, OC sends the discount in discount_amount_cart
---
Just going to test now when the discount amount is greater than the shipping value to see what happens. (this is for my own satisfaction and doesnt help you though)
Just to add my research.. which maybe you already know...
Paypal only applies discounts to the "item total" and does not consider shipping or tax or handling to be "discount-eligible"
So if you have
Item Subtotal: 10
Shipping: 10
Discount: -10
Total: 10
Paypal will reject it because the discount is greater or equal to the item total

Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
-

Qphoria - Administrator
- Posts: 18209
- Joined: Mon Jul 21, 2008 7:02 pm

Re: [vQmod] Apply coupon during checkout
michaelgbarnes wrote:Hello all,
Simon suggested I post my issue here regarding this mod.
I've reviewed both threads and installed both scripts with vqmod. Neither of them has any effect on the checkout page. I have only installed modules with vqmod and read that it was important to have unmodded files. Do you have any thoughts on what might cause neither of them to function at all?
I've checked user group permissions and everything appears normal otherwise.
Thanks in advance
I too am experiencing exactly the same problem. I have installed vQmod, and dropped the replacement xml file in the xml folder on vQmod.
But do not see the voucher code box in option 5.
Any help appreciated as it is desperately needed.
Thanks in advance

- amcitsolutons
- Posts: 8
- Joined: Fri Sep 09, 2011 10:32 am
Re: [vQmod] Apply coupon during checkout
Tested it and works perfectly..
Will there be any mod for gift voucher as well as rewards points?
Will there be any mod for gift voucher as well as rewards points?
- terrier
- Posts: 27
- Joined: Wed Aug 31, 2011 11:05 am
Re: [vQmod] Apply coupon during checkout
Can you do it for voucher (Gift Card)?
- xfacor
- Posts: 16
- Joined: Fri Sep 02, 2011 4:11 am
Re: [vQmod] Apply coupon during checkout
anyway.. to solve all these problems.. the easiest way is customer must go shopping cart before checkout.
therefore I route all checkout path to cart.
In that case all rewards, voucher, coupon will definately be there to entry before checkout!
therefore I route all checkout path to cart.
In that case all rewards, voucher, coupon will definately be there to entry before checkout!

- terrier
- Posts: 27
- Joined: Wed Aug 31, 2011 11:05 am
Re: [vQmod] Apply coupon during checkout
First of all - thank you for J.Neuhoff for creating this wonderful vQmod. I had been searching for an answer since I upgraded from 1.4.x to 1.5.x.
For those that are not running the default template (like myself) I had to make 1 minor change to make the pp_standard.tpl file from my template match the default template in order for the coupon amount to transfer to PayPal.
The change was the addition of the following lines (at line 23):
Now my customers can enter a coupon code in the standard checkout process and it is deducted from their PayPal amount due.
Thank you again!
For those that are not running the default template (like myself) I had to make 1 minor change to make the pp_standard.tpl file from my template match the default template in order for the coupon amount to transfer to PayPal.
The change was the addition of the following lines (at line 23):
- Code: Select all
<?php if ($discount_amount_cart) { ?>
<input type="hidden" name="discount_amount_cart" value="<?php echo $discount_amount_cart; ?>" />
<?php } ?>
Now my customers can enter a coupon code in the standard checkout process and it is deducted from their PayPal amount due.
Thank you again!
- SandCarver
- Posts: 12
- Joined: Wed Nov 17, 2010 3:14 pm
Re: [vQmod] Apply coupon during checkout
seems to be working fine for me on oc1513 thank you!
- clapiana
- Posts: 38
- Joined: Thu Sep 01, 2011 10:22 am
Re: [vQmod] Apply coupon during checkout
Does anyone have this vQmod tweaked for Shoppica? I confirmed it works with default theme on 1.5.1.3, but when I tried it on Shoppica (also running 1.5.1.3), no luck. Thanks!
- favfan
- Posts: 5
- Joined: Fri Sep 02, 2011 10:15 pm
Re: [vQmod] Apply coupon during checkout
Works fine for me too on 1.5.1.3!
Thanks!
Thanks!
- john121park121
- Posts: 15
- Joined: Tue Aug 30, 2011 3:24 pm
Re: [vQmod] Apply coupon during checkout
JNeuhoff wrote:Here is an updated VQmod XML file which should fix the bug with IE8:
Notice it is for Opencart 1.5.1.1 only, don't report bugs for other Opencart versions!
Hi,
thanks for writing this code.
It works fine for IE 8 and other browsers now, but is it possible to fix it for IE7?
Thanks in advance!
- goodweather
- Posts: 1
- Joined: Wed Aug 31, 2011 1:58 am
Re: [vQmod] Apply coupon during checkout
My build of OC is 1.5.0.5, but this should work for everyone:
If you use a theme other than the default, you MUST list your theme name in directory to make this mod visible. Lines 29 and 53 are the culprits.
Line 29:
Line 53:
Hope it helps!
If you use a theme other than the default, you MUST list your theme name in directory to make this mod visible. Lines 29 and 53 are the culprits.
Line 29:
<file name="catalog/view/theme/[YOUR THEME NAME]/template/checkout/payment.tpl">
Line 53:
$('#button-coupon').after('<span class="wait"> <img src="catalog/view/theme/[YOUR THEME NAME]/image/loading.gif" alt="" /></span>');
Hope it helps!
- travoltron
- Posts: 9
- Joined: Thu Nov 03, 2011 8:07 pm
Re: [vQmod] Apply coupon during checkout
I know this is not made for 1.5.1.3, but I can see there are people using 1.5.1.3 that has make this work ... but how?
- kungmats
- Posts: 53
- Joined: Tue Jan 25, 2011 3:00 pm
Re: [vQmod] Apply coupon during checkout
kungmats wrote:I know this is not made for 1.5.1.3, but I can see there are people using 1.5.1.3 that has make this work ... but how?
Hi;
it works for me on the 1.5.1.3 you just have to modify line 23
<file name="catalog/view/theme/default/template/checkout/payment.tpl">
To:
<file name="catalog/view/theme/NAME OF YOUR THEME/template/checkout/payment.tpl">
Hope that works for you

- nytrous
- Posts: 25
- Joined: Mon Oct 24, 2011 6:24 pm
Re: [vQmod] Apply coupon during checkout
I've done both th line 29 and 53 but it doesn'n help.
Can I have your url to the shop so i can see how it appears?
Can I have your url to the shop so i can see how it appears?
- kungmats
- Posts: 53
- Joined: Tue Jan 25, 2011 3:00 pm
Re: [vQmod] Apply coupon during checkout
ok, I can see you dont have guest check out ... is it ok if I just do a test account? and you can delete it afterwords,
- kungmats
- Posts: 53
- Joined: Tue Jan 25, 2011 3:00 pm
Re: [vQmod] Apply coupon during checkout
Thanks ... yes I can see the coupon option
, but it wont work on my page
http://shop.specialkompaniet.com
, but it wont work on my page
http://shop.specialkompaniet.com
- kungmats
- Posts: 53
- Joined: Tue Jan 25, 2011 3:00 pm
Re: [vQmod] Apply coupon during checkout
here is my code:
Maibe theres something there that you miss!
- Code: Select all
<modification>
<id>Opencart core file modifications for adding coupon support into the checkout sequence</id>
<version>1.5.1.1</version>
<vqmver>1.2.3</vqmver>
<author>mhccorp.com</author>
<file name="catalog/controller/checkout/payment.php">
<operation>
<search position="after"><![CDATA[$this->data['text_comments'] = $this->language->get('text_comments');]]></search>
<add><![CDATA[
$this->data['entry_payment_coupon'] = $this->language->get('entry_payment_coupon');
$this->data['text_payment_coupon'] = $this->language->get('text_payment_coupon');
$this->data['text_payment_coupon_success'] = $this->language->get('text_payment_coupon_success');
$this->data['button_coupon'] = $this->language->get('button_coupon');
]]></add>
</operation>
</file>
<file name="catalog/language/portuguese-br/checkout/checkout.php">
<operation>
<search position="after"><![CDATA[$_['text_comments']]]></search>
<add><![CDATA[
$_['entry_payment_coupon'] = 'Coloque o codigo do seu cupão (se disponivel) e clique em Aplicar cupão"';
$_['text_payment_coupon'] = 'Código de cupão de desconto:';
$_['text_payment_coupon_success'] = 'O seu cupão de disconto foi aplicado correctamente no total da sua encomenda. Irá verificar isso no proximo passo quando verificar o total.';
$_['button_coupon'] = 'Aplicar Cupão';
]]></add>
</operation>
</file>
<file name="catalog/view/theme/netde-1/template/checkout/payment.tpl">
<operation>
<search position="after" offset="2"><![CDATA[<textarea name="comment"]]></search>
<add><![CDATA[
<div id="coupon">
<b><?php echo $entry_payment_coupon; ?></b><br /><br />
<?php echo $text_payment_coupon; ?>
<input type="text" name="coupon" value="" />
<a id="button-coupon" class="button"><span><?php echo $button_coupon; ?></span></a></div><br />
</div>
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[<script type="text/javascript"><!--]]></search>
<add><![CDATA[
<script type="text/javascript"><!--
$('#button-coupon').bind('click', function() {
$.ajax({
type: 'POST',
url: 'index.php?route=total/coupon/calculate',
data: $('#coupon :input'),
dataType: 'json',
beforeSend: function() {
$('#button-coupon').attr('disabled', true);
$('#button-coupon').after('<span class="wait"> <img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#button-coupon').attr('disabled', false);
$('.wait').remove();
},
success: function(json) {
if (json['error']) {
alert( json['error'] );
} else {
$("input[name=coupon]").val("");
alert( "<?php echo $text_payment_coupon_success; ?>" );
}
}
});
});
//--></script>
]]></add>
</operation>
</file>
</modification>
Maibe theres something there that you miss!
- nytrous
- Posts: 25
- Joined: Mon Oct 24, 2011 6:24 pm
Re: [vQmod] Apply coupon during checkout
Nope 
Using your code but changing to my data did not help.
On line 53 you have the theme set to default instead of netde-1 ... but it works anyway
... strange
Do you have any file in the folder /vqmod/vqcache/
that says coupon?

Using your code but changing to my data did not help.
On line 53 you have the theme set to default instead of netde-1 ... but it works anyway
... strangeDo you have any file in the folder /vqmod/vqcache/
that says coupon?
- kungmats
- Posts: 53
- Joined: Tue Jan 25, 2011 3:00 pm
Who is online
Users browsing this forum: No registered users and 5 guests















