Jump to content



Latest News: (loading..)

* * * - - 3 votes

[add-on] Discount Code (support)


  • Please log in to reply
134 replies to this topic

#121   GLime

GLime
  • Members
  • 30 posts
  • Real Name:Gabriel

Posted 09 October 2012 - 08:40 PM

All lot of us are having the similar issue. Basicaly on the checkout confirmation page the total is calulated like so.

Sub-total + (sub-total * taxes) - discount = final total

While it shouyld be  Sub-total + ((sub-total - discount) * taxes) - discount

However the displayed taxes rate is well caluclated.

I have written to http://high-quality-php-coding.com and will write back here once I have news from them.

#122   GLime

GLime
  • Members
  • 30 posts
  • Real Name:Gabriel

Posted 10 October 2012 - 07:00 PM

Good news, they answered. Here is what they told me.

Quote

Hello Gabriel,

Thank you for your interest in our product.

Actually we use the following formulas:
New Total = Total - Discount
New Tax = (Sub-Total - Discount) * (Tax Value / Discount)

> Can you explain me please how I could modify my code? I love your addon and would really like to add it to my live shop.

Please refer to the file
catalog/includes/modules/
order_total/ot_discount.php.

Sincerely,
The High Quality PHP Coding Team.

I'm not sure why they divided the taxes by the discount but anyways, now that I know where to look for I should be able to midify their formula even thought their code is slightly hard to understand.

#123   AdamArscott

AdamArscott
  • Members
  • 4 posts
  • Real Name:Adam Arscott

Posted 26 October 2012 - 08:46 PM

Hi,

I have installed this contribution and everything is working fine expect when I go through checkout and type in the discount code it isnt accepted, the little 'cog' just spins round and round with no error or final verification of the code being accepted. Another thing is that whilst the code is being 'verified' I cannot make any changes to it, I cant even delete it. I am reasonably new to PHP coding so I might be missing something very obvious, so apologies in advance if that is the case.

Adam

#124   p3dro

p3dro
  • Members
  • 2 posts
  • Real Name:Pedro

Posted 29 October 2012 - 01:06 PM

Hi,

i'm have the same problem, the little 'cog' just spins round and round with no error or final verification of the code being accepted.

My version oscommerce 2.3.1 with jquery-1.4.3.min

Any suggestions.

Best Regards

#125   era4eva

era4eva
  • Members
  • 5 posts
  • Real Name:Era
  • Gender:Female

Posted 01 November 2012 - 06:06 AM

Hi Guys,

I've installed the PayPal express fix for this module, discounts are being taken into consideration in the total, however the shipping costs are not included?
Has anyone encountered the same problem or know the solution to this?

Any information is greatly appreciated.

Thanks!!!!

#126   AdamArscott

AdamArscott
  • Members
  • 4 posts
  • Real Name:Adam Arscott

Posted 02 November 2012 - 10:54 AM

View Postp3dro, on 29 October 2012 - 01:06 PM, said:

Hi,

i'm have the same problem, the little 'cog' just spins round and round with no error or final verification of the code being accepted.

My version oscommerce 2.3.1 with jquery-1.4.3.min

Any suggestions.

Best Regards

Mine was a quick fix and it turned out to be that I hadn't uploaded the ot_discounts file to the right place. When I first did the install i selected the folder that the files were in and uploaded but this isn't the right way to do it, after uploading the files individually I got it to work. HOWEVER!! since then the discounts weren't being applied and I had a very unhelpful response from the author which basically said they couldn't help me. I have figured out the problem was with PayPal payments and install necessary updates but now I have a checkout page which is displays the correct total but there is no breakdown of totals and the currency is in US$ not GBP.

Any ideas?

#127   lilpenny1316

lilpenny1316
  • Members
  • 18 posts
  • Real Name:SanHan

Posted 02 November 2012 - 03:27 PM

Has anyone been able to get this to work with the Free Payment checkout module?  When I apply a 100% off coupon, the sub-total still shows the original price and the final price shows $0.00, but the Free Product payment option still does not appear.  There is a discount code module that does work with the Free Payment checkout module, but it is now as admin-user friendly as this one.  Any ideas?  Thanks!

#128   AdamArscott

AdamArscott
  • Members
  • 4 posts
  • Real Name:Adam Arscott

Posted 03 November 2012 - 04:09 PM

View PostAdamArscott, on 02 November 2012 - 10:54 AM, said:

Mine was a quick fix and it turned out to be that I hadn't uploaded the ot_discounts file to the right place. When I first did the install i selected the folder that the files were in and uploaded but this isn't the right way to do it, after uploading the files individually I got it to work. HOWEVER!! since then the discounts weren't being applied and I had a very unhelpful response from the author which basically said they couldn't help me. I have figured out the problem was with PayPal payments and install necessary updates but now I have a checkout page which is displays the correct total but there is no breakdown of totals and the currency is in US$ not GBP.

Any ideas?

I have since solved this issue by visiting another thread (http://forums.oscommerce.com/topic/381238-paypal-changes-from-gbp-to-usd/) but now my problem is that on the PayPal checkout page I have the correct total but I dont have any product description, tax, shipping or discount information. Just a total. Can anyone help?

#129   SharperJacks

SharperJacks
  • Members
  • 13 posts
  • Real Name:Johnny
  • Gender:Not Telling

Posted 07 November 2012 - 01:27 PM

I have the same problem AdamArscott my PayPal Express is not showing any of the item's descriptions or taxes or shipping. I have tried to fix this but with no luck. I hope to find the solution soon.

#130   Denyer

Denyer
  • Members
  • 2 posts
  • Real Name:Martin

Posted 19 December 2012 - 04:11 PM

I realise this is a little out of date now but if anyone's interested in order to get the itemised summary working in paypal use the following code in catalog/ext/models/payment/paypal/express.php

	 // Discount Code - start
	 include(DIR_WS_MODULES . 'order_total/ot_discount.php');
	 $ot_discount = new ot_discount;
	 $ot_discount->process();
	 $discountCodeAmount = $ot_discount->output[0]["value"];
	 if($discountCodeAmount != 0)
	 {
	   $params['L_NAME'.$line_item_no] = 'Discount Coupon';
	   $params['L_AMT'.$line_item_no] = $discountCodeAmount;
	   $params['L_QTY'.$line_item_no] = 1;
	   $params['ITEMAMT'] += $discountCodeAmount;
	   $params['AMT'] += $discountCodeAmount;
	 }
	 // Discount Code - end

This is to replace the following code:

	 // Discount Code - start
	 include(DIR_WS_MODULES . 'order_total/ot_discount.php');
	 $ot_discount = new ot_discount;
	 $ot_discount->process();

	 $params = array();
	 $params['AMT'] = $paypal_express->format_raw($order->info['total'], '', 1);
	 // Discount Code - end

This change will add the discount coupon as a line item in the summary with a negative value.

Cheers,
Denyer

Edited by Denyer, 19 December 2012 - 04:12 PM.


#131   Denyer

Denyer
  • Members
  • 2 posts
  • Real Name:Martin

Posted 19 December 2012 - 10:10 PM

Actual the follwoing code is a slight improvement (essentially the same)

	  // Discount Code - start
	  include(DIR_WS_MODULES . 'order_total/ot_discount.php');
	  $ot_discount = new ot_discount;
	  $ot_discount->process();
	  if($discount > 0)
	  {

		$params['L_NAME'.$line_item_no] = 'Discount Coupon';
		$params['L_AMT'.$line_item_no] = -$discount;
		$params['L_QTY'.$line_item_no] = 1;
		$params['ITEMAMT'] -= $discount;
		$params['AMT'] -= $discount;
	  }
	  // Discount Code - end


#132   florenceuk

florenceuk
  • Members
  • 2 posts
  • Real Name:Florence

Posted 20 January 2013 - 10:28 AM

duplicated discounted amount passed to Barclaycard epqd osCommerce 2.3.1 Payment Module

Hi Guys,

I also installed this addon and got the latest version 3.1.1 for my oscommerce V2.3.1.  It works perfectly on Paypal standard.  The problem appeared when I added Barclaycard epqd as one more payment option.  Whenever customers choose Barclaycard instead of paypal to make the payment,  the discount code was used twice.

i.e.  when choosing Barclaycard to pay,  in checkout_confirmation.php

Sub-total - discount = final total to pay.

Then click continue to Barclaycard payment page:

final total - discount (again) = new final total    -  this double discounted new total is the amount shown in the credit card payment page.   the customer is getting double discount at the end.

when choosing paypal standard to pay,  the correct amount (Sub-total - discount = final total) will be passed to paypal.

I have been searching google and working on it for more than one week and cannot seem to find any answer.  It seems nobody has this problem before.  I emailed Barclaycard and tried to find out which addon has problem:  the barclaycard addon or the discount code addon,  but no reply from them.    I also emailed the contributor of this addon,  hopefully I can get reply from them one day...  meanwhile I hope if anyone knows where the problem is please let me know..

I used http://addons.oscommerce.com/info/7700   discount code for oscommerce 2.3.1 and http://addons.oscommerce.com/info/8602  Barclaycard osCommerce 2.3.1 Payment Module.  

Thank you so much for any advice!

Florence

#133   florenceuk

florenceuk
  • Members
  • 2 posts
  • Real Name:Florence

Posted 22 January 2013 - 05:35 PM

problem solved.  :) If anyone come across this problem,  here is the solution:

in barclaycard.php

put:

$Amount = round($this->format_currency($order->info['total']),2)*100;


in front of

$order_totals = $order_total_modules->process();

Edited by florenceuk, 22 January 2013 - 05:36 PM.


#134   Sylvester99

Sylvester99
  • Members
  • 31 posts
  • Real Name:Dwane
  • Gender:Male

Posted 25 January 2013 - 02:26 PM

Just a note to anyone who intends to use this contribution in conjunction with the Loyalty Rewards contribution:

It is nothing short of painful to get these 2 contributions to work correctly and calculate tax correctly.  Discount Codes requires that 'Sub Total' be #1 in the sort order but Loyalty Rewards requires that it be before 'Sub Total'.  The 2 can co-exist together (After hours of playing around with it!) and be correct however I found that I had to turn of display of the 'Tax' module as it displayed incorrectly.

The total and sub-total are displayed correctly even with the Order Total 'Tax' modeul turned on, however 'Tax' displays an incorrect value by not taking into account the Discount Code component of the 'Sub Total'.

Example using 10% tax:

$1000 Order Value
$100 Loyalty Rewards (10%)
$50 Discount Code
$850 Sub Total
$90 Tax ((Order Value - Loyalty Rewards) x 10%)

The Tax should be $85 ((Order Value- Loyalty Rewards - Discount Code) x 10%)

This work around simply does not display the tax on the Order Confirmation page, Invoice or Order Confirmation Email.  I also ammended the wording in the language file from 'Sub-Total' to 'Sub-Total (Includes 10% Tax)'.

This is by no means a fix - Simply a work around.  I hope this helps someone get these 2 working together kind-of correctly!

#135   lilpenny1316

lilpenny1316
  • Members
  • 18 posts
  • Real Name:SanHan

Posted 04 March 2013 - 04:47 PM

I was able to add a coupon description field in the database along with an input field in the backend, but I cannot figure out how to display this on the checkout confirmation page.  Has anyone been able to successfully add a coupon description?