Re: [vQmod] Apply coupon during checkout
Posted: Sat Nov 19, 2011 7:36 am
just this one, nothing more, it might be something on your theme! try to use the default one and see the result!
OpenCart Community Forum - Discuss shopping cart and e-commerce solutions.
https://forum.opencart.com/
Yeah mine is installed in 1.5.1.3kghandi wrote:I upgraded to v 1.5.3.1 from 1.4.9. I really like the one page checkout except for the fact that it does not allow entry of coupon codes. I tried applying the vqmod posted at the top of this thread but it has not worked. Has anyone tried this with v 1.5.3.1 yet?
Thanks
Code: Select all
<file name="catalog/view/theme/[YOUR THEME NAME]/template/checkout/payment.tpl">
Code: Select all
$('#button-coupon').after('<span class="wait"> <img src="catalog/view/theme/[YOUR THEME NAME]/image/loading.gif" alt="" /></span>');
indigo wrote:Hi Scoobs .... are you using the default template?
If not, remember to change
Line 29:Line 53:Code: Select all
<file name="catalog/view/theme/[YOUR THEME NAME]/template/checkout/payment.tpl">
Code: Select all
$('#button-coupon').after('<span class="wait"> <img src="catalog/view/theme/[YOUR THEME NAME]/image/loading.gif" alt="" /></span>');
Hope it helps!
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/english/checkout/checkout.php">
<operation>
<search position="after"><![CDATA[$_['text_comments']]]></search>
<add><![CDATA[
$_['entry_payment_coupon'] = 'Enter your code (if available) and click "Apply Coupon"';
$_['text_payment_coupon'] = 'Discount Coupon Code:';
$_['text_payment_coupon_success'] = 'Your discount coupon has been successfuly applied to your order. You will see it in the next checkout step';
$_['button_coupon'] = 'Apply Coupon';
]]></add>
</operation>
</file>
<file name="catalog/view/theme/yostore/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><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/yostore/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>
Read this !burley wrote:I installed it but can't seem to get it to work in 1.5.1, I haven't got any custom templates.
Has anybody got it to work on version 1.5.1? Or do I have to upgrade?
Code: Select all
<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>
Wasn't this fix working for you?fsroque wrote:The script had a problem in ie7 where it would make the payment step disappear in opencart 1.5.1.3.
Attached is the fixed version, working for 1.5.1.3. Remember to change the theme if you do not use the default.
scoobs001 wrote:I solved my issue,
Remove and re-install VQMOD along with new XML files