Page 3 of 8

Re: [vQmod] Apply coupon during checkout

Posted: Sat Sep 10, 2011 10:17 pm
by Qphoria
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

Re: [vQmod] Apply coupon during checkout

Posted: Sun Sep 11, 2011 12:26 am
by amcitsolutons
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 ;D

Re: [vQmod] Apply coupon during checkout

Posted: Sun Sep 18, 2011 5:08 pm
by terrier
Tested it and works perfectly..

Will there be any mod for gift voucher as well as rewards points?

Re: [vQmod] Apply coupon during checkout

Posted: Mon Sep 19, 2011 10:31 pm
by xfacor
Can you do it for voucher (Gift Card)?

Re: [vQmod] Apply coupon during checkout

Posted: Mon Sep 19, 2011 10:39 pm
by terrier
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! :)

Re: [vQmod] Apply coupon during checkout

Posted: Mon Sep 19, 2011 11:35 pm
by SandCarver
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):

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!

Re: [vQmod] Apply coupon during checkout

Posted: Thu Oct 06, 2011 4:24 am
by clapiana
seems to be working fine for me on oc1513 thank you!

Re: [vQmod] Apply coupon during checkout

Posted: Tue Oct 18, 2011 7:10 am
by favfan
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!

Re: [vQmod] Apply coupon during checkout

Posted: Fri Oct 21, 2011 2:54 am
by john121park121
Works fine for me too on 1.5.1.3!

Thanks!

Re: [vQmod] Apply coupon during checkout

Posted: Wed Nov 09, 2011 12:46 pm
by goodweather
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!

Re: [vQmod] Apply coupon during checkout

Posted: Thu Nov 17, 2011 1:00 am
by travoltron
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:
<file name="catalog/view/theme/[YOUR THEME NAME]/template/checkout/payment.tpl">
Line 53:
$('#button-coupon').after('<span class="wait">&nbsp;<img src="catalog/view/theme/[YOUR THEME NAME]/image/loading.gif" alt="" /></span>');
Hope it helps!

Re: [vQmod] Apply coupon during checkout

Posted: Fri Nov 18, 2011 9:41 pm
by kungmats
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?

Re: [vQmod] Apply coupon during checkout

Posted: Sat Nov 19, 2011 2:43 am
by nytrous
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 :)

Re: [vQmod] Apply coupon during checkout

Posted: Sat Nov 19, 2011 3:09 am
by kungmats
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?

Re: [vQmod] Apply coupon during checkout

Posted: Sat Nov 19, 2011 4:11 am
by nytrous

Re: [vQmod] Apply coupon during checkout

Posted: Sat Nov 19, 2011 4:24 am
by kungmats
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,

Re: [vQmod] Apply coupon during checkout

Posted: Sat Nov 19, 2011 4:26 am
by nytrous
you can test now with the guest checkout ;)

Re: [vQmod] Apply coupon during checkout

Posted: Sat Nov 19, 2011 4:32 am
by kungmats
Thanks ... yes I can see the coupon option ;D , but it wont work on my page :(
http://shop.specialkompaniet.com

Re: [vQmod] Apply coupon during checkout

Posted: Sat Nov 19, 2011 4:39 am
by nytrous
here is my code:

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; ?>&nbsp;
  <input type="text" name="coupon" value="" />
  &nbsp;<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">&nbsp;<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!

Re: [vQmod] Apply coupon during checkout

Posted: Sat Nov 19, 2011 4:53 am
by kungmats
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?