Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Discount Coupon Codes


kgt

Recommended Posts

Your area correct in some ways, but I don't think it is a bug, more of a matter or preference. The CCGV (Trid) Contirb works in the way your describing. Either all cats are included or just the one(s) you select. You may want to try using that one.

 

Good luck

 

Thanks for the feedback candleman. I think maybe my choice of the word "bug" was extreme. It definitely is more a useability issue, but I do believe it needs to be corrected in some way. This is potentially how many users of this contrib are having issues with the coupon code not working. They could be thinking that there is something wrong with the code or the way they installed it, when in fact they accidentally excluded the parent category that contained the sub-category they were trying to include in the discount. At the very least, some documentation needs to be written explaining this procedure to users. I may attempt to do this myself when I am not busy working on my current project.

 

Best regards,

Agra

Edited by agrafuese
Link to comment
Share on other sites

EDIT TO MY POST ABOVE:

 

I just saw the section of the manual at the very bottom where it explains exclusions. KGT does refer to a scenario where a product might be in two different categories, therefore requiring both to be on the "included" side. While this is related to the issue I've described, it is not exactly the same. I just wanted to make that clear, in case there was any confusion.

 

-Agra

Link to comment
Share on other sites

Hi all just wondering if anyone has had a chance to look into my earlier post about offering a totally free item. To recap my problem I can get the code to apply and the item is zero cost but when the customer goes through the checkout they are sent to Paypal regardless and the order process stops there.

 

I need for the system to recognize there is no cost and by pass the Paypal redirect.

 

Thanks again for all of attention.

Link to comment
Share on other sites

Hello everyone,

 

I am one of the users of this contribution who is having problems with the order subtotal not being displayed properly. To recap, here's the problem:

 

When the "Display subtotal with applied discount" option is set to false, the discount is STILL applied, and what's worse is that it is applied to the total again. So it gets applied twice. Both my order.php and checkout_confirmation.php files are identical to the ones in the latest release, so I know it wasn't a problem with the way the code was applied. If anyone would like to see my debug output, I will be more than happy to post it or send it in a PM.

 

Anyway, if you have any clue at all as to what might be going on here, please let me know. Thank you.

 

-Agra

Link to comment
Share on other sites

Hello

I've a heavily modified oscommerce ms2 version and i've installed the version 3.31 of discount coupon code.

I've some problem when the customer enters a bad discount coupon, or a coupon with bad criterias (minimum account not reach for example), the customer is redirected to the login.php file and do not see an error.

did you ever seen this problem ?

 

thanks

Bobby l'ours poilu

Link to comment
Share on other sites

Hey all, just checking back about my question earlier, after adding this contribution, my products double in price during the checkout process. For example, if the item cost $10, the sub-total now says $20, and so on. I feel like I really screwed up the code somehow. If anyone can help, please let me know.

Link to comment
Share on other sites

My developer recently added this coupon module. However, he tells me it only works with Paypal, as Google Checkout takes my customers offsite for the checkout process.

 

Does anyone know a work around for this?

 

I tried adding the same code to Google Checkout, but it keeps telling me the code is Invalid. It's showing as current, and is typed precisely (as entered with some caps)

 

Thanks for any help!

Lanae

Link to comment
Share on other sites

Attention all users experiencing problems with the discount being applied to the subtotal (and twice to the overall order) when the "Display subtotal with applied discount" option is set to false:

 

Please see my bug fix on the contribution page -

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

 

DO NOT message me about this fix. I made it for myself, and it works for me. I am only sharing it in hopes that it may help you too. If it does not work for you, simply uninstall it. I am not responsible for any problems that may arise from installing it.

 

Good luck,

Agra

Link to comment
Share on other sites

Attention all users experiencing problems with the discount being applied to the subtotal (and twice to the overall order) when the "Display subtotal with applied discount" option is set to false:

 

Please see my bug fix on the contribution page -

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

 

DO NOT message me about this fix. I made it for myself, and it works for me. I am only sharing it in hopes that it may help you too. If it does not work for you, simply uninstall it. I am not responsible for any problems that may arise from installing it.

 

Good luck,

Agra

 

Simple replace and my problems are history!!! Way to go Agra!!!! Thanks again!!!! :lol:

Link to comment
Share on other sites

FOR ALL USERS OF MY SUBTOTALS BUG FIX:

 

I've just uploaded an optional fix for those who use osC's table method for calculating shipping cost. If you've downloaded my previous bug fix and use the table method for calculating shipping costs, you MUST download this new fix as well. I've also made it a combo-fix for users who haven't already downloaded the previous fix. See the contribution page for more info:

 

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

 

If you don't use the table method for calculating shipping costs, there is no need to install this new fix, and it could in fact cause more problems if you do.

Link to comment
Share on other sites

I have the same problem (Products doubling in price). It all looks good to me, except for the Sub-Total!

 

Buying these two items:

5 x test product*** $0.05

1 x 1/4 Zip Sweatshirt***

- Color: Ash

- Size: Adult M $32.00

Discount Coupon 5Z490H applied: -$3.21

Sub-Total: $60.90

Total: $57.69

 

Here is the Debug Output: (I hope it's not bad form to post such a long output here!)

 

<!-- Discount Coupons DEBUG

order Object

(

[info] => Array

(

[order_status] => 1

[currency] => USD

[currency_value] => 1.00000000

[payment_method] => Pay by Check - Pick Up at CCHS

[cc_type] =>

[cc_owner] =>

[cc_number] =>

[cc_expires] =>

[shipping_method] =>

[shipping_cost] =>

[subtotal] => 60.895

[tax] => 0

[tax_groups] => Array

(

[unknown tax rate] => 0

)

 

[comments] =>

[total] => 57.69

)

 

[totals] => Array

(

)

 

[products] => Array

(

[0] => Array

(

[qty] => 5

[name] => test product

[model] => RB-TEST

[tax] => 0

[tax_description] => Unknown tax rate

[price] => 0.0100

[final_price] => 0.01

[weight] => 0.00

[id] => 62

)

 

[1] => Array

(

[qty] => 1

[name] => 1/4 Zip Sweatshirt

[model] => RB-2

[tax] => 0

[tax_description] => Unknown tax rate

[price] => 32.0000

[final_price] => 32

[weight] => 0.00

[id] => 48{1}28{2}4

[attributes] => Array

(

[0] => Array

(

[option] => Color

[value] => Ash

[option_id] => 1

[value_id] => 28

[prefix] => +

[price] => 0.0000

)

 

[1] => Array

(

[option] => Size

[value] => Adult M

[option_id] => 2

[value_id] => 4

[prefix] => +

[price] => 0.0000

)

 

)

 

)

 

)

 

[customer] => Array

(

[firstname] => dgsdfg

[lastname] => sdfg

[company] =>

[street_address] => 19112 sdfg

[suburb] =>

[city] => sdfg

[postcode] => 45677

[state] => Oregon

[zone_id] => 49

[country] => Array

(

[id] => 223

[title] => United States

[iso_code_2] => US

[iso_code_3] => USA

)

 

[format_id] => 2

[telephone] => 666-66-6666

[email_address] => [email protected]

)

 

[delivery] => Array

(

[firstname] => dfg

[lastname] => dgf

[company] =>

[street_address] => 19112 sdfg

[suburb] =>

[city] => sdfg

[postcode] => 45677

[state] => Oregon

[zone_id] => 49

[country] => Array

(

[id] => 223

[title] => United States

[iso_code_2] => US

[iso_code_3] => USA

)

 

[country_id] => 223

[format_id] => 2

)

 

[content_type] => physical

[billing] => Array

(

[firstname] => sdfg

[lastname] => sdfg

[company] =>

[street_address] => 19112 sdfg ct

[suburb] =>

[city] => sdfg

[postcode] => 34566

[state] => Oregon

[zone_id] => 49

[country] => Array

(

[id] => 223

[title] => United States

[iso_code_2] => US

[iso_code_3] => USA

)

 

[country_id] => 223

[format_id] => 2

)

 

[coupon] => discount_coupon Object

(

[messages] => Array

(

[debug] => Array

(

[0] => INFO: DISPLAY_PRICE_WITH_TAX = false

[1] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_ALLOW_NEGATIVE = false

[2] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_LINES = false

[3] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_RANDOM_CODE_LENGTH = 6

[4] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_TYPE = true

[5] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_SORT_ORDER = 0

[6] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS = true

[7] => INFO: MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING = false

[8] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DEBUG = true

[9] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_CONFIG = Discount Coupon

 applied

[10] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_USE_LANGUAGE_FILE = false

[11] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_EXCLUDE_SPECIALS = true

[12] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_TAX = None

[13] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_SUBTOTAL = false

[14] => INFO: Product 62 passed exclusion check. Discount 0.005 applied. (percent)

[15] => INFO: Discount of 0.005 applied to product 62 ($0.05).

[16] => INFO: Calculating tax on 0.045. Displayed price 0.045.

[17] => INFO: Product 48{1}28{2}4 passed exclusion check. Discount 3.2 applied. (percent)

[18] => INFO: Discount of 3.2 applied to product 48{1}28{2}4 ($32).

[19] => INFO: Calculating tax on 28.8. Displayed price 28.8.

[20] => INFO: Discount of 3.205 applied to order total.

)

 

)

 

[coupon] => Array

(

[coupons_id] => 5Z490H

[coupons_description] => Single Membership

[coupons_discount_amount] => 0.100000000000

[coupons_discount_type] => percent

[coupons_date_start] => 2007-09-01 00:00:00

[coupons_date_end] => 2008-09-01 00:00:00

[coupons_max_use] => 0

[coupons_min_order] => 0.0000

[coupons_min_order_type] => price

[coupons_number_available] => 0

)

 

[applied_discount] => Array

(

[unknown tax rate] => 3.205

)

 

[cart_info] => Array

(

[valid_products] => Array

(

[count] => 6

[line_items] => 2

[total] => 32.05

)

 

[total_products] => Array

(

[count] => 6

[line_items] => 2

[total] => 32.05

)

 

[exclusions] => Array

(

[categories] => Array

(

)

 

[products] => Array

(

)

 

[manufacturers] => Array

(

)

 

)

 

)

 

[discount_tax] => Array

(

[unknown tax rate] => 0

)

 

)

 

)

 

End Discount Coupons DEBUG-->

Link to comment
Share on other sites

well i have found the answer of my problem

if you install discount coupon codes + ultimate seo, there is a problem from ultimate seo if you check the boxe "Output W3C valid URLs (parameter string)?" to true

in this case, if there's an error, checkout_confirmation.php will redirect the user to checkout_process.php?error=...&osCid=...

The problem is &, it is converted in &amp so it isn't valid anymore.

so the solution is the uncheck the "Output W3C valid URLs (parameter string)?" option

 

regards

bobby l'ours qui pue du slip

Link to comment
Share on other sites

Hey all,

 

I'm installing the Discount Coupon Codes 3.3 module at the moment however I'm getting the following error message when attempting to checkout the purchase :

 

1146 - Table 'jbfadmin.TABLE_DISCOUNT_COUPONS_TO_CATEGORIES' doesn't exist

 

SELECT categories_id FROM TABLE_DISCOUNT_COUPONS_TO_CATEGORIES WHERE coupons_id=""

 

[TEP STOP]

 

any ideas what could be causing this?

 

Thanks for any help.

Link to comment
Share on other sites

Hi,

 

A tech installed a discounting mechanism for our infostore at http://www.platts.com/infostore/index.php. It seems to work except for our products that have multiple versions listed. Problem is, the tech up and quit last week and I have no idea how to remedy this! On this one, for example: http://www.platts.com/infostore/product_in...;products_id=82

 

When I test using a code on one of those products (code is U1107B) I get an error on the first and 3rd version listed. Error reads:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or z2g.zone_id = 0 or z2g.zone_id IS NULL ) ' at line 5

 

SELECT dc2z.geo_zone_id FROM discount_coupons_to_zones dc2z LEFT JOIN zones_to_geo_zones z2g USING( geo_zone_id ) WHERE ( z2g.zone_id= or z2g.zone_id = 0 or z2g.zone_id IS NULL ) AND ( z2g.zone_country_id= or z2g.zone_country_id = 0 ) AND dc2z.coupons_id="U1107B"

 

[TEP STOP]

 

Any idea what this is telling me? For the life of me I cannot figure out how to select the versions when setting up the discount. When I select the products I want discounted, I just get the name of the entire product, not the 3 versions of it.

 

Thanks and if you wish to email me directly, please free to do so at [email protected].

Link to comment
Share on other sites

Hey all, just checking back about my question earlier, after adding this contribution, my products double in price during the checkout process. For example, if the item cost $10, the sub-total now says $20, and so on. I feel like I really screwed up the code somehow. If anyone can help, please let me know.

 

I had the same problem and just found the solution (to what I did):

 

The instructions say for catalog/include/classes/order.php

FIND on line 244:

 

$shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];

$this->info['subtotal'] += $shown_price;

 

REPLACE with this code:

 

//kgt - discount coupons

if( is_object( $this->coupon ) ) {

$applied_discount = 0;

$discount = $this->coupon->calculate_discount( $this->products[$index], $valid_products_count );

if( $discount['applied_discount'] > 0 ) $valid_products_count++;

$shown_price = $this->coupon->calculate_shown_price( $discount, $this->products[$index] );

 

WHAT I DID (by mistake) was ADD the code, not replace.

 

That fixed the subtotal portion. Now I have to find out what I did to cause the actual discount to be applied twice.

 

Jerry

Link to comment
Share on other sites

Hey all,

 

I'm installing the Discount Coupon Codes 3.3 module at the moment however I'm getting the following error message when attempting to checkout the purchase :

 

1146 - Table 'jbfadmin.TABLE_DISCOUNT_COUPONS_TO_CATEGORIES' doesn't exist

 

SELECT categories_id FROM TABLE_DISCOUNT_COUPONS_TO_CATEGORIES WHERE coupons_id=""

 

[TEP STOP]

 

any ideas what could be causing this?

 

Thanks for any help.

 

Looks like the SQL hasn't run to update your Database yet. The error is telling you that a database table that is needed does not exist. Did you upload the catalog/includes/modules/order_total/ot_discount_coupon.php to your site? This file should run the SQL to create the discount_coupons_to_categories table (and several others) in your database :thumbsup:

~Tracy
 

Link to comment
Share on other sites

While I'm not sure what all is happening on your site - the error is showing that the z2g.zone_country_id is not being found (which is why there is no number after the = sign).

 

Why you would have the Country ID on one product, but not the other two, I have no idea? You might need to compare some of your code with code from another site that is using the same contributions as yours. Do you know what contributions have been installed on your site?

 

 

 

Hi,

 

A tech installed a discounting mechanism for our infostore at http://www.platts.com/infostore/index.php. It seems to work except for our products that have multiple versions listed. Problem is, the tech up and quit last week and I have no idea how to remedy this! On this one, for example: http://www.platts.com/infostore/product_in...;products_id=82

 

When I test using a code on one of those products (code is U1107B) I get an error on the first and 3rd version listed. Error reads:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or z2g.zone_id = 0 or z2g.zone_id IS NULL ) ' at line 5

 

SELECT dc2z.geo_zone_id FROM discount_coupons_to_zones dc2z LEFT JOIN zones_to_geo_zones z2g USING( geo_zone_id ) WHERE ( z2g.zone_id= or z2g.zone_id = 0 or z2g.zone_id IS NULL ) AND ( z2g.zone_country_id= or z2g.zone_country_id = 0 ) AND dc2z.coupons_id="U1107B"

 

[TEP STOP]

 

Any idea what this is telling me? For the life of me I cannot figure out how to select the versions when setting up the discount. When I select the products I want discounted, I just get the name of the entire product, not the 3 versions of it.

 

Thanks and if you wish to email me directly, please free to do so at [email protected].

~Tracy
 

Link to comment
Share on other sites

This contribution is installed and working fine on my site.. but... I'm aiming for a better ordering process. I want the customer to KNOW what their total is, including discounts, before confirming a payment method.

 

The order I'm aiming at is:

shopping cart

shipping (& discounts)

summary (like the confirmation page, but only displays the financial aspects)

payment

confirmation

 

I have successfully moved the coupon box to the shipping page. But it doesn't do anything. It is not verifying the coupon and it is not affecting the summary on the next page.

 

What code do I have to carry over to make this work?

 

For testing you can use this coupon code: onebuck

If it works, you will save $1

Link to comment
Share on other sites

Hi all, kgt this is a fantastic contribution, nice work.

 

I'm having a slight problem with it though, the codes work fine, everything works brilliant throughout the shop, BUT when looking at the orders in admin, all orders that have had the discount code applied do not show the order confirmation, comments etc. boxes. The order cannot be edited from pending to delivered, which is a problem.

 

Have I missed soemthing from the install, or is this a common thing. Is there a way I can get the order edit selection back, as it is fine with all orders not placed with a discount, only with orders placed with a discount do I lose the comments table

 

Any help would be great

Link to comment
Share on other sites

I have just installed the discount coupon codes and I am getting this error when I am in admin/catalog/discount coupons

 

Discount Coupons

1054 - Unknown column 'cd.date_end' in 'order clause'

 

select * from discount_coupons cd order by cd.date_end, date_start limit 0, 20

 

[TEP STOP]

 

 

 

 

I am not sure what the above means. Please help me get this working......

 

Thanks, Louise

Link to comment
Share on other sites

I installed this add-on about a year ago, and it works great with % discounts. I've been trying to get it to work with a fixed amount, but it's way off. I know it says in the manual that it can be off with a few cents or whatever, but this is way off.

 

I'm making a giftcertificate worth 250 NOK and have set the fixed amount to 250, the min order and max order amounts to 250. So there should be a 250 NOK discount on the order. But when I test this out (and I have created several coupons that all show the same), only a discount of 180 NOK is displayed and subtracted at the checkout. That's 70 NOK off and that's about $15 difference (not just a few cents). What's causing this?

 

This is what I have my coupon module set as:

 

Display Discount Coupon

true

 

Sort Order

1

 

Display Discount with Minus (-) Sign

true

 

Display Subtotal with Applied Discount

true

 

Random Code Length

6

 

Display Discount Total Lines for Each Tax Group?

false

 

Use the language file to format display string?

true

 

Display Format for Order Total Line

Discount Coupon

 applied

 

Any ideas? I've been subtracting GCs manualle up until now, and just been using the codes for % discounts in newsletters etc, but I would really love to get the fixed amount to work.

 

I have no other order total modules installed, if that's any help.

Link to comment
Share on other sites

I have just installed the discount coupon codes and I am getting this error when I am in admin/catalog/discount coupons

 

Discount Coupons

1054 - Unknown column 'cd.date_end' in 'order clause'

 

select * from discount_coupons cd order by cd.date_end, date_start limit 0, 20

 

[TEP STOP]

I am not sure what the above means. Please help me get this working......

 

Thanks, Louise

 

Louise,

 

Did you check your database to see if the new tables were installed? and if all the columns are correct?

Link to comment
Share on other sites

I installed this add-on about a year ago, and it works great with % discounts. I've been trying to get it to work with a fixed amount, but it's way off. I know it says in the manual that it can be off with a few cents or whatever, but this is way off.

 

I'm making a giftcertificate worth 250 NOK and have set the fixed amount to 250, the min order and max order amounts to 250. So there should be a 250 NOK discount on the order. But when I test this out (and I have created several coupons that all show the same), only a discount of 180 NOK is displayed and subtracted at the checkout. That's 70 NOK off and that's about $15 difference (not just a few cents). What's causing this?

 

...

 

Any ideas? I've been subtracting GCs manualle up until now, and just been using the codes for % discounts in newsletters etc, but I would really love to get the fixed amount to work.

 

I have no other order total modules installed, if that's any help.

 

Are you finding this issue when the discount is applied to any order or just specific ones? I was finding a similar issue when I had a $0 item in my cart. Try checking for patterns if it is not consistent.

 

Also, You want to use this as a GC? Keep in mind, those should normally be applied after tax, not before. A flat rate discount is more like a coupon when handled by this mod. The difference this will make depends on the tax rate you have. I posted an example about 2 screens back if you want to see.

Link to comment
Share on other sites

The following error occurs when you change the shipping method at the checkout confirmation page,

 

1062 - Duplicate entry '1TIME-10' for key 1

 

insert into discount_coupons_to_orders (coupons_id, orders_id) values ('1TIME', '10')

 

One odd thing about this is that the order_id of 10 is not the current order number, it is 12.

 

any ideas.

Link to comment
Share on other sites

Louise,

 

Did you check your database to see if the new tables were installed? and if all the columns are correct?

 

 

Hi, thanks for replying. I have just had a look and there seems to be coupon tables but I don't really know how to check if the columns are correct or anything further. I confess to having no knowledge, I have learnt everything as I have gone along, sorry for being a dummy about this!

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