[add-on] Discount Code (support)
#121
Posted 09 October 2012 - 08:40 PM
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
Posted 10 October 2012 - 07:00 PM
Quote
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
Posted 26 October 2012 - 08:46 PM
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
Posted 29 October 2012 - 01:06 PM
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
Posted 01 November 2012 - 06:06 AM
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
Posted 02 November 2012 - 10:54 AM
p3dro, on 29 October 2012 - 01:06 PM, said:
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
Posted 02 November 2012 - 03:27 PM
#128
Posted 03 November 2012 - 04:09 PM
AdamArscott, on 02 November 2012 - 10:54 AM, said:
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
Posted 07 November 2012 - 01:27 PM
#130
Posted 19 December 2012 - 04:11 PM
// 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
Posted 19 December 2012 - 10:10 PM
// 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
Posted 20 January 2013 - 10:28 AM
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
Posted 22 January 2013 - 05:35 PM
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
Posted 25 January 2013 - 02:26 PM
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
Posted 04 March 2013 - 04:47 PM









