Post by tophat » Wed Aug 22, 2012 4:41 am

I'm surprised this is not standard in Opencart to be honest. People expect to apply a coupon discount when looking at the totals and committing to purchase as on the checkout. Anyhow, any kind person here able to write this to work with the latest opencarts? Thanks.

Webmaster for: http://www.getlaidbeds.co.uk + www.mattressmoose.co.uk + www.pixellounge.co.uk


User avatar
Active Member

Posts

Joined
Fri Nov 25, 2011 8:31 am


Post by beuh_dave » Sun Sep 23, 2012 10:06 am

msmith wrote:Hi, I added a bit of code and now you get coupon + voucher in checkout with one vqmod. It seems to work fine for me in 1.5.3.1.
checkout-coupon-voucher.xml
Works great for OpenCart 1.5.4! Thank you!

Newbie

Posts

Joined
Tue Sep 18, 2012 10:08 pm

Post by steph71 » Thu Sep 27, 2012 4:00 am

I'm using OC 1.5.1.3

When using Paypal Standard which gives a total without discount :

100€ - 20% = 80€ in OC, you have to pay 100€ on the Paypal standard page,

When using Paypal Hosted :

100€ - 20% in OC, you have to pay 80€ on the Paypal Hosted page (!!)

Maybe someone that knows how to read code might be inspired to see Paypal Hosted one and adapt it for Paypal Standard,

Best regards.

Newbie

Posts

Joined
Thu Feb 23, 2012 5:28 pm

Post by kays » Fri Sep 28, 2012 4:20 pm

Using 1.5.4.1 and this shows well in shopping cart.

Is anyone else having issues with coupon where you must be logged for coupon to work? And I do have it checked as "NO" customer does not have to log in. Any thoughts?

Thanks

Newbie

Posts

Joined
Tue Sep 11, 2012 7:32 pm

Post by gpsyroxy » Sat Nov 24, 2012 11:35 pm

Hi,
I am using open cart 1.5.4 and shoppica2 theme. I try everything I can but, it did not work. I change the word english with my language and the word default with my theme name. Also I reinstall vqmod and cleared the cache.
Thank you.

Newbie

Posts

Joined
Sat Nov 24, 2012 11:23 pm

Post by samdz » Thu Nov 29, 2012 2:53 am

Hi;

@ gpsyroxy :
Try this modification or extension, it is for free.

http://www.opencart.com/index.php?route ... on_id=9519

It support Shoppica2.

Sam

Active Member

Posts

Joined
Fri Jan 28, 2011 3:02 am

Post by broadfeed » Mon Mar 18, 2013 4:03 am

Hi,
Could you tell me how I can change "coupon" to "promo"?

I thought it would be in catalog/language/english/checkout/checkout.php but there don't seem to be any references there.

I've managed to change it for the cart.

Thanks.

Newbie

Posts

Joined
Sat Dec 01, 2012 3:41 am

Post by griff4594 » Wed May 01, 2013 4:45 am

I have a small problem with this mod, when I put in the coupon code on the checkout page it will not process the coupon code. Is there a fix for this? I attached a screenshot of the process

Attachments

4-30-2013 2-42-15 PM.png

4-30-2013 2-42-15 PM.png (171.77 KiB) Viewed 7179 times


Kevin Griffith
Developer


Newbie

Posts

Joined
Mon Feb 04, 2013 11:32 pm


Post by fma1955 » Thu Jun 13, 2013 4:31 pm

Hello,
I added the .xml file through VQMod and it said the upload was successful but I get the error "

---------- Date: 2013-06-13 17:42:12 ~ IP : 122.148.224.250 ----------
REQUEST URI : /admin/index.php?route=module/vqmod_manager&token=5dcccd29eef944a2613b6526f0483c37
MOD DETAILS:
modFile : /smhhome/a-web/a1/1d/flowbenchoz.com/public/vividlaser/vqmod/xml/checkout-coupon.xml
id : Opencart core file modifications for adding coupon support into the checkout sequence
version : 1.5.1.1
vqmver : 1.2.3
author : mhccorp.com
Could not resolve path for [catalog/controller/checkout/payment.php] (SKIPPED)
Could not resolve path for [catalog/view/theme/default/template/checkout/payment.tpl] (SKIPPED)

I checked my files and there is no [payment.php] or payment.tpl].
I have OC 1.5.5.1 could you help please?

Newbie

Posts

Joined
Fri May 24, 2013 5:53 pm

Post by jubbbird » Wed Nov 27, 2013 12:02 am

I've just installed this mod on v1.5.4 and it worked perfectly first time, it appears. Thanks very much indeed.

I want to add that I think it's best if the first post in this thread is updated with all the version downloads. I had to read through everything, and to a string search for the OP's name to find all the various versions he's made available throughout the discussion, only to discover that the one I needed to download was in fact the last one published.

So I can confirm that the last one published at the time of writing works perfectly for a custom theme derived from the default theme on v1.5.4. I copied the XML file into the vqmod folder and it worked like a charm straight away.

Newbie

Posts

Joined
Mon Mar 28, 2011 12:30 am

Post by garxina » Thu Nov 28, 2013 7:02 am

samdz wrote:Hi;

@ gpsyroxy :
Try this modification or extension, it is for free.

http://www.opencart.com/index.php?route ... on_id=9519

It support Shoppica2.

Sam
Hi,
It works for me but it doesn't apply the theme (the button image doesn't appear) Also i've 1.5.4.1 and shoppica 2 and this extension (http://www.opencart.com/index.php?route ... on_id=9519) installed
Can somebody help me?
problemaplantillacheckout.png

problemaplantillacheckout.png (20.37 KiB) Viewed 6641 times

Thanks!

New member

Posts

Joined
Sun Apr 15, 2012 11:22 pm

Post by Eenuh » Mon Dec 02, 2013 1:11 am

I am trying to use this to get the coupon to show up during checkout, however I can't get it to work with my Dutch version of the website. How do I modify the file so that it can be used with both English and Dutch?

This is the Dutch part that should be used:

Code: Select all

<file name="catalog/language/dutch/checkout/checkout.php">
		<operation>
			<search position="after"><![CDATA[$_['text_comments']]]></search>
			<add><![CDATA[
			 <?php if ($discount_amount_cart) { ?>
  <input type="hidden" name="discount_amount_cart" value="<?php echo $discount_amount_cart; ?>" />
  <?php } ?>
$_['entry_payment_coupon']           = 'Voer uw code in (indien beschikbaar) en klik op "Gebruik Kortingsbon"';
$_['text_payment_coupon']            = 'Kortingsbon Code:';
$_['text_payment_coupon_success']    = 'Uw kortingsbon is met succes toegevoegd aan uw bestelling. U zult deze in de volgende stap zien.';
$_['button_coupon']                  = 'Gebruik Kortingsbon';
			]]></add>
		</operation>
	</file>

But then I don't know how to implement it in the file to get it to work properly. Any help? Please note that I am a coding n00b (as in, I know nothing about it). :P

Newbie

Posts

Joined
Tue Nov 22, 2011 2:42 am

Post by garxina » Mon Dec 02, 2013 5:51 am

Hi,

to have it in english too you must to duplicate those code but translated in english, like the original version:

Code: Select all

<file name="catalog/language/english/checkout/checkout.php">
      <operation>
         <search position="after"><![CDATA[$_['text_comments']]]></search>
         <add><![CDATA[
          <?php if ($discount_amount_cart) { ?>
  <input type="hidden" name="discount_amount_cart" value="<?php echo $discount_amount_cart; ?>" />
  <?php } ?>
$_['entry_payment_coupon']           = 'English translation';
$_['text_payment_coupon']            = 'English translation:';
$_['text_payment_coupon_success']    = 'English translation';
$_['button_coupon']                  = 'English translation';
         ]]></add>
      </operation>
   </file>

New member

Posts

Joined
Sun Apr 15, 2012 11:22 pm

Post by Eenuh » Mon Dec 02, 2013 6:43 am

Thanks for your reply!

I had altered the file to have both the English and Dutch in there, but the way I did it did not seem to work, it just gives me an error during checkout. So I am probably missing something/doing something wrong. Here is the code with both English and Dutch in it:

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[
			 <?php if ($discount_amount_cart) { ?>
  <input type="hidden" name="discount_amount_cart" value="<?php echo $discount_amount_cart; ?>" />
  <?php } ?>
$_['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/language/dutch/checkout/checkout.php">
		<operation>
			<search position="after"><![CDATA[$_['text_comments']]]></search>
			<add><![CDATA[
			 <?php if ($discount_amount_cart) { ?>
  <input type="hidden" name="discount_amount_cart" value="<?php echo $discount_amount_cart; ?>" />
  <?php } ?>
$_['entry_payment_coupon']           = 'Voer uw code in (indien beschikbaar) en klik op "Gebruik Kortingsbon"';
$_['text_payment_coupon']            = 'Kortingsbon Code:';
$_['text_payment_coupon_success']    = 'Uw kortingsbon is met succes toegevoegd aan uw bestelling. U zult deze in de volgende stap zien.';
$_['button_coupon']                  = 'Gebruik Kortingsbon';
			]]></add>
		</operation>
	</file>
	<file name="catalog/view/theme/default/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><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>

Newbie

Posts

Joined
Tue Nov 22, 2011 2:42 am

Post by garxina » Tue Dec 03, 2013 11:58 pm

I haven't a lot of knowledge about code modifications :$ Have you download the correct script for your version of oc?

New member

Posts

Joined
Sun Apr 15, 2012 11:22 pm

Post by Qphoria » Fri Jan 22, 2016 12:22 am

Added new version to the first post that supports all versions of 1.5.x and 2.x as this is still a great and very much needed mod.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by gerstnerusa » Fri Jan 22, 2016 7:02 am

Just downloaded the updated mod and it works great in Opencart 1.5.3.1.

Thanks Qphoria for the update.

Newbie

Posts

Joined
Sat Feb 09, 2013 6:56 am

Post by bruiseviolet » Thu May 12, 2016 12:47 am

Using OpenCart 2.1.0.1 and getting the following error when refreshing the modifications screen after uploading the xml file.
Notice: Trying to get property of non-object in /xxxx/yyyy/zzzz/admin/controller/extension/modification.php on line 142Warning: Cannot modify header information - headers already sent by (output started at /xxxx/yyyy/zzzz/admin/index.php:84) in /xxxx/yyyy/zzzz/system/library/response.php on line 12

On a side note- I don't understand why this isn't just standard to have coupons on the checkout page. We get 2-5 customers EVERYDAY calling or emailing us because they can't find where to put in a coupon code.

Newbie

Posts

Joined
Tue Feb 16, 2016 1:10 am

Post by Qphoria » Thu May 12, 2016 10:25 pm

bruiseviolet wrote:Using OpenCart 2.1.0.1 and getting the following error when refreshing the modifications screen after uploading the xml file.
Notice: Trying to get property of non-object in /xxxx/yyyy/zzzz/admin/controller/extension/modification.php on line 142Warning: Cannot modify header information - headers already sent by (output started at /xxxx/yyyy/zzzz/admin/index.php:84) in /xxxx/yyyy/zzzz/system/library/response.php on line 12
This is unrelated.. are you trying to load a vqmod as ocmod? because that won't work unless you are running a customized ocmod that supports vqmod
http://www.opencart.com/index.php?route ... n_id=19501

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by tsvetko.krastev » Wed Jun 15, 2016 4:20 pm

Is this working in OC 2.2?

New member

Posts

Joined
Wed Mar 23, 2016 3:36 pm
Location - Sofia, Bulgaria
Who is online

Users browsing this forum: No registered users and 6 guests