Jump to content
high-quality-php-coding

[add-on] Discount Code (support)

Recommended Posts

I have downloaded the package and installed the files..

 

I'm now trying to do the following:

 

 

1. Perform the SQL query to your osCommerce database.

 

ALTER TABLE `discount_codes` ADD `exclude_specials` TINYINT( 1 ) NOT NULL AFTER `order_info` ;

Can someone give me some guidance on how to do this, I'm a newby at the stuff..

I have gone into phpMyAdmin and opened the database I need, but not sure what to do next..

Share this post


Link to post
Share on other sites

Hello

 

I'm using osCommerce Online Merchant v2.3.1 and tried to install the Discount Code.

 

After applying everything, it was working fine to create discount codes. But when a customer has put some articles into the shopping cart, he was not able to checkout. So he was able to display the shopping cart, but when he was clicking on "checkout" then nothing happened, just the page reloaded...

 

Can anyone help me please?

 

Thank you!!!

Share this post


Link to post
Share on other sites

Everything's set now, but the discount doesn't get calculated at the end :mellow:

 

I'm now sitting the whole sunday in front of this addon and it's not getting to an end, could anyone help me please? What could be the problem?

 

In the instruction there is written the following:

7. Modify the catalog/checkout_process.php file.
Find:
//------insert customer choosen option eof ----
   $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
   $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
   $total_cost += $total_products_price;
   $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
 }
Add after:
 // Discount Code 2.3 - start
 if (MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'true') {
   if (!empty($discount)) {
  $discount_codes_query = tep_db_query("select discount_codes_id from " . TABLE_DISCOUNT_CODES . " where discount_codes = '" . tep_db_input($sess_discount_code) . "'");
  $discount_codes = tep_db_fetch_array($discount_codes_query);
  tep_db_perform(TABLE_CUSTOMERS_TO_DISCOUNT_CODES, array('customers_id' => $customer_id, 'discount_codes_id' => $discount_codes['discount_codes_id']));
  tep_db_query("update " . TABLE_DISCOUNT_CODES . " set number_of_orders = number_of_orders + 1 where discount_codes_id = '" . (int)$discount_codes['discount_codes_id'] . "'");
  tep_session_unregister('sess_discount_code');
   }
 }
 // Discount Code 2.3 - end

 

But in my checkout_process.php file there is no code like this, it's looking a bit different:

//------insert customer choosen option eof ----
   $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
 }

 

could it be related to this? what do I need to do so that it will finally work?

Share this post


Link to post
Share on other sites

Hi, I have the same problem, does anyone know how to resolve this? It seems the discount codes are not being recognised when input during the checkout process

 

Please help

Share this post


Link to post
Share on other sites

Is it possible to change the discount code from a 8 character code to a 10 character code? Thanks

Share this post


Link to post
Share on other sites

I can tell you it is because it is "skipping" the order total.php when you use the paypal express module. I am having the same problem. It was quick and easy to install and set up but it's not set up to be used with the PP module. I just contacted the creators of the add-on and I am awaiting a response.

Share this post


Link to post
Share on other sites

I'm really excited about using this add-on, as I'm hoping to provide discounts to members of my website's newsletter. I installed version 3.1.1 and then updated it to 3.2 following all directions. The module seems to calculate the tax properly, but if I have it set to anything BUT "apply to order subtotal" it's displaying the wrong tax amount (even though the order total is correct)!

 

Here's an example:

 

1. With "apply to order total" set and a discount of 10%:

 

Subtotal: $25.00

Discount: -$2.50

Tax: $2.70

Total: $25.50

 

2. With "apply to category" set and the same (10%) discount:

 

Subtotal: $25.00

Discount: -$2.50

Tax: $2.73

Total $25.50

 

I have checked my file modifications twice, but everything seems to be correct. Can anyone help me figure out what's wrong and why it's displaying the wrong tax amount even though it's calculating it correctly?

 

Thanks!

 

Regards,

 

Chris

Edited by Chrison

Share this post


Link to post
Share on other sites

I'm really excited about using this add-on, as I'm hoping to provide discounts to members of my website's newsletter. I installed version 3.1.1 and then updated it to 3.2 following all directions. The module seems to calculate the tax properly, but if I have it set to anything BUT "apply to order subtotal" it's displaying the wrong tax amount (even though the order total is correct)!

 

Here's an example:

 

1. With "apply to order total" set and a discount of 10%:

 

Subtotal: $25.00

Discount: -$2.50

Tax: $2.70

Total: $25.50

 

2. With "apply to category" set and the same (10%) discount:

 

Subtotal: $25.00

Discount: -$2.50

Tax: $2.73

Total $25.50

 

I have checked my file modifications twice, but everything seems to be correct. Can anyone help me figure out what's wrong and why it's displaying the wrong tax amount even though it's calculating it correctly?

 

Thanks!

 

Regards,

 

Chris

 

I'm bumping this one because it's still a problem. Can anyone help me figure this one out, please?

 

Thanks!

 

Regards,

 

Chris

Share this post


Link to post
Share on other sites

I'm bumping this one because it's still a problem. Can anyone help me figure this one out, please?

 

Thanks!

 

Regards,

 

Chris

 

Never mind. I never did figure out why this was happening, so I uninstalled this add-on and changed over to CCGV Credit Class Gift Voucher 6.0 instead. Happily, it installed without a hitch and works flawlessly.

 

Thanks, anyway...

 

Regards,

 

Chris

Share this post


Link to post
Share on other sites

I have installed the addon and is working very well. The only problem is that the product description has disappeared from the paypal login page when checking out. All that shows now is the total amount that will be paid with no product description.

 

Has someone come across this problem and is there a fix for it?

 

Thanks for any help

Edited by paccman

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

Hi,

 

I'm using this addon but when it comes to putting the code in on the checkout process page it is showing as failed even though the code is set up.

 

Can someone please help?

 

Thanks

Share this post


Link to post
Share on other sites

Hi,

 

I'm using this addon but when it comes to putting the code in on the checkout process page it is showing as failed even though the code is set up.

 

Can someone please help?

 

Thanks

Same here - using 2.3.2


Getting the Phoenix off the ground

Share this post


Link to post
Share on other sites

Same here - using 2.3.2

added to wrong application_top

 // Discount Code 3.1.1 - start
 if (MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'true') {
   if (!tep_session_is_registered('sess_discount_code')) tep_session_register('sess_discount_code');
   if (!empty($HTTP_GET_VARS['discount_code'])) $sess_discount_code = tep_db_prepare_input($HTTP_GET_VARS['discount_code']);
   if (!empty($HTTP_POST_VARS['discount_code'])) $sess_discount_code = tep_db_prepare_input($HTTP_POST_VARS['discount_code']);
 }
 // Discount Code 3.1.1 - end

 

Fixed


Getting the Phoenix off the ground

Share this post


Link to post
Share on other sites

Hey every one, @@paccman just wondering if you managed to sort this issue out, as i currently have it, i tried editing the express.php file and changing the $params, but it keeps throwing errors. so just edited it back to the discount code read me file.

 

But just like your self my express checkout doesn't display anything. but the price

 

Example: Check out with pay-pal express only displays:

 

 

Your order summary

 

Descriptions

Current purchase £1.00

 

Item total £1.00

Total £1.00 GBP

 

it seems to display correctly in PayPal Website Payments Standard

But again the description is only displaying my website / business name and no item information:

 

Your order summary

 

Descriptions

 

test site

 

amount

 

£42.42

 

Item price: £42.42

Quantity: 1

Discount-£2.52

 

Item total£39.90

VAT£7.98

Postage and packaging: £5.00

Total £52.88 GBP

 

any ideas would be great thanks

 

 

David

Share this post


Link to post
Share on other sites

maybe this has been already solved, if so, sorry, give me please just the link of the solution....

 

It seems that as start / end date I have to use the format MM/DD/YYYY (let say 12/31/2012).

But if I edit the coupon it then shows the format DD/MM/YYYY (i.e. 31/12/2012). Upon saving it again, the date does not fit to MM/DD/YYYY and it will be lost.....

 

I have find out the function kgt_parse_date which seems to be responsible for that.

 

Is anyone here using it in the admin with a different format then DD/MM/YYYY?

Am I missing a configuration point?

 

Many thx for your time!

Edited by davidedp

Share this post


Link to post
Share on other sites

[...]

I have find out the function kgt_parse_date which seems to be responsible for that.

[...]

Solved! I added jquery Calendar to both date fields!

Share this post


Link to post
Share on other sites

I have got the Discount Code module installed on my (thankfully test) web store.

 

The module seems to be running - I set up a discount code and then I try it out... and the discount codes seem to work.

That is it shows a line where the discount is applied, but the numbers don't add up.

 

For example I ran a test item priced 34.99 and a 10% discount.

I get the following results when I run a test purchase.

 

Price: $34.99

Discount: -$3.50

Shipping: $15.00

FL TAX 7% $2.22

Total: $48.94

 

First off the total is wrong: 34.99 - 3.50 + 15:00 + 2.22 = 48.71 It does Not equal 48.94

 

The other issue is that I have no idea where the 2.22 comes from.

 

34.99 x 0.07 = 2.45 (total price x 7%)

 

31.49 x 0.07 = 2.20 (discounted price x 7%)

 

46.49 x 0.07 = 3.25 (discount price + shipping x 7%)

 

I have no idea where this module get it totals from.

 

I and running osCom 2.3 - the Discount Code is Dec 26, 2011 version with the March 12, 2012 update.

 

Any suggestions?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

 

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!!!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×