Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[add-on] Discount Code (support)


Recommended Posts

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?

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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://www.oscommerce.com/forums/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?

Link to comment
Share on other sites

  • 1 month later...

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

  • 1 month later...
  • 8 months later...

Hi, I need something quite easy.

 

I need to change the color of the text in the order confirmation page.

The one that says: Discount Coupon ABCDEF applied: -£3.60

 

Any idea how to do it.

I tried to change it through the language file, like this but didn't work:

 

define('MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_FILE', '<span class="discount_txt_red">Discount Coupon applied</span>');

 

And I made the discount_txt_red class in the css file

Link to comment
Share on other sites

if any one know the solution,please help.

 

i need to add a some type of customer groups and discount based on the amount of they purchased.

type of customers are regular,clubs etc..conditions are :if regular no discount .

clubs, If the club spends $100-$249, the discount is 40%

- If the club spends $250-$499, the discount is 45%..

for this i create 2 new table in database

 

 

 

1.customer_group

2.discount

 

customer_group

1.id(int,primary key,auto increment)

2.name(varchar )

3.sort_order(int)

 

 

in admin module i add new pages(customers_group.php,discount) for to specify the kind of users(Regular User,club..)&discount details(regular-0%, club 100-249 :40%,club 250-400:50%)

.so on the registration side a customer need to select a existing customer type that defined by the admin.

 

i create other table

 

discount

1.discount_id(int)

2.customer_group_id(int)

3.slimit(int) ---------- (short form for starting limit)

4.elimit (int) ------------(short form for ending limit)

5.discount(int). for storing discount details..

 

now the admin part is almost complete.and this 2 pages are working properly.

 

Now the problem is that ,i don't know how to give discount base on these values(if discount is given then subtotal amount with discount must be visible in corresponding pages like..shopping_cart.php,checkout_shipping.php,checkout_payment.php,checkout_confirmation.php,admin/orders.php etc)

when every customer is enter to their on account page the corresponding customer type is fetch from the table customers(in this table i add a new column customers_group_id which store the corresponding customers group id).

 

so i need to give discount base on these..please help me.

Edited by ronssss4
Link to comment
Share on other sites

  • 2 weeks later...

Hi

 

Does the latest version of this add-on work on Oscommerce 2.3.3.4?

 

I just installed it on my 2.3.3.4 version although you may or may not have to make one change.

 

 

 

 

On line 201 of admin/coupons.php change

 

$coupons_split = new splitPageResults( $HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS_ADMIN, $coupons_query_raw, $coupons_query_numrows );

 

To

 

$coupons_split = new splitPageResults( $HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $coupons_query_raw, $coupons_query_numrows );

 

Link to comment
Share on other sites

  • 2 weeks later...

Alright, I've been using this contrib for awhile on another site, installed it on my new store and am having some silly issues with it.

 

I was getting 'undefined' showing up in the discount codes box in Safari, and Safari absolutely will not apply the discount code, returns it as invalid no matter the circumstances. Mobile safari for iOS seems to be similarly hamstrung.

 

Works fine in Chrome and Firefox. Any suggestions? Please?

 

Hi I have the same problem as you.

I installed 2.3.3.4 on Oscommerce module discount coupons, and Safari not 'running right.

 

Just when checkout_payment.php step to checkout_confirmation.php coupon simply not counted.

 

This only happens with Safari. In Chrome, Firefox, etc, everything works fine.

 

Any idea??

 

Thank you!

Edited by Pentaxeros
Link to comment
Share on other sites

  • 4 months later...

Hi, I'm using Discount Code 3.1 for OsC 2.2.

I'm having problems with tax not being affected by the discount.

 

I think my problem is that the tax_discount array is empty on checkout_confirmation.php and not affecting the shown tax.

 

I've been looking at ot_tax.php and ot_discount.php to try and fix it.

 

Any suggestions?

 

(Have tried some of the things in this thread, but no dice)

Link to comment
Share on other sites

Hi, I'm using Discount Code 3.1 for OsC 2.2.

I'm having problems with tax not being affected by the discount.

 

I think my problem is that the tax_discount array is empty on checkout_confirmation.php and not affecting the shown tax.

 

I've been looking at ot_tax.php and ot_discount.php to try and fix it.

 

Any suggestions?

 

(Have tried some of the things in this thread, but no dice)

 

Emailed high-quality-php-coding and they helped me.

Had to get the includes/modules/order_total/ot_discount.php from 3.2 for osc 2.3.1

 

Now the taxes and discount work like a charm, as long as you order them correctly...

Link to comment
Share on other sites

  • 3 months later...

This topic is pretty old so I hope I am posting to the correct spot.

 

I am running oscommerce 2.3.1 and I have recently been trying to install Discount code.  I first installed version 2.6 and I was able to add the module in admin and configure a code.  But, I was not able to get the discount to apply.  I then noticed that 3.1.1 was a full install as well and then I could apply the latest update of 3.2.  So, I went to my backup and installed version 3.1.1 for osCommerce 2.3.1

 

Once I did this I am not able to add the module in the administration area.  It shows as 2 modules needing to be installed but when I click on them everything in order_total just goes away.  I have done a compare of files between version 2.6 and 3.1.1 and I'm not able to find the culprit.  Can someone point me in the right direction with this?

 

Thanks.

Link to comment
Share on other sites

Hi,

 

Could be a previous module or may be the discount coupon order_total modules The thread does seem to have died

 

This one works

 

http://addons.oscommerce.com/info/7644

 

seen a few bugs but does the job

 

I would suggest  to all members to take the time to look for the support thread and see if it is active so many changes the last few years

 

some addons are simply outdated with no support

 

Regards

joli

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

I'm having real problems with this add on and my heavily modded site. The discount works as it should but the problem I'm having is on checkout_payment.php. When a code is entered into the discount box, pressing enter to validate the code just forwards to the next page, checkout_confirmation.php. It should validate the code and let the user know if the code is valid or not. Looking at my checkout_confirmation page, if the code is accepted the discount is taken off but I need to show the customer on the checkout_payment page if they entered a wrong code or indeed the correct code.

 

Any ideas on why the page would just forward to the next page? I suspect it's a javascript issue. Done some testing and it seems to be connecting to the discount_code.php page and passing back the data value.

Ah, the world wide web. What a wonderful place.

Link to comment
Share on other sites

  • 2 months later...

I love this contrribution

  I was wondering if there is a way to add the ACTUAL Discount PERCENT given.

    Right now, I have the Discount Code... but would also like to have the discount % added too

      Discount (bf2014):      to this     Discount (bf2014 - 25%):

 

Sub-Total: $67.90
Discount (bf2014): -$16.98
USPS Slow Mail (via FedEx SmartPost): $15.00
Total: $65.93

 

Cheers,  Todd

Link to comment
Share on other sites

OK... I got this code to work... 
      $this->output[] = array('title' => TEXT_DISCOUNT . (!empty($order_info) ? ' (' . $sess_discount_code . ' - ' . $check['discount_values'] . ')' : '') . ':',
          Output is:    Discount (bf2014 - 25%): -$16.98

 

NOW Trying to get it to look like this:  25% Discount (bf2014): -$16.25

How do I re-arrange the code ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...