Jump to content



Photo
* * * * * 5 votes

[Contribution] Discount Coupon Codes


  • Please log in to reply
3390 replies to this topic

#21   kgt

kgt
  • Members
  • 2,883 posts
  • Real Name:KG Thorson

Posted 09 June 2006 - 13:41

I've just installed this coupon contribution and it's calling this error, when I go to>Products>Discount Coupon (to create the coupon/set parameters):
Discount Coupons
1146 - Table 'libidolondon_com_-_store.discount_coupons' doesn't exist

select count(*) as total from discount_coupons cd

[TEP STOP]



Looks like you didn't run the SQL statements in the install instructions, or there was an error when you ran it.

#22   kgt

kgt
  • Members
  • 2,883 posts
  • Real Name:KG Thorson

Posted 09 June 2006 - 13:44

And in the admin part I can't add new coupon discounts in the menu over sql it works !!


Do you get an error? What happens?

#23   Cubez

Cubez
  • Members
  • 3 posts
  • Real Name:Cubez

Posted 09 June 2006 - 13:55

Try adding this code:

if (!tep_session_is_registered('coupon')) tep_session_register('coupon');
  if (tep_not_null($HTTP_POST_VARS['coupon'])) {
	$coupon = tep_db_prepare_input($HTTP_POST_VARS['coupon']);
  }
BEFORE these lines:
require(DIR_WS_CLASSES . 'order.php');
  $order = new order;


Thanks! That worked like a charm. /thumbsup.gif' class='bbc_emoticon' alt=':thumbsup:' />

I may have some answers too. When I first installed this contribution I couldn't create coupons either. It had something to do with the field values not being received. I changed all insert and update values in coupons.php to $_POST[""] values and then everything worked.

example

tep_db_input($coupons_description) . "', '" .
tep_db_input($coupons_discount_percent) ."', " .

to

tep_db_input($_POST["coupons_description"]) . "', '" .
tep_db_input($_POST["coupons_discount_percent"]) ."', " .


#24   kgt

kgt
  • Members
  • 2,883 posts
  • Real Name:KG Thorson

Posted 09 June 2006 - 14:03

I may have some answers too. When I first installed this contribution I couldn't create coupons either. It had something to do with the field values not being received. I changed all insert and update values in coupons.php to $_POST[""] values and then everything worked.



Great, I'll make some changes to the checkout_confirmation that will hopefully solve this problem for everyone. And I will make changes to the admin page while I'm at it.

#25   Libido

Libido
  • Members
  • 11 posts
  • Real Name:Kelly Garland
  • Location:Ontario, Canada

Posted 09 June 2006 - 15:08

Looks like you didn't run the SQL statements in the install instructions, or there was an error when you ran it.



I did a manual install..since I'm not fluent in sql. (wouldn't know where to begin)

I've made the suggested mods :

tep_db_input($_POST["coupons_description"]) . "', '" .
tep_db_input($_POST["coupons_discount_percent"]) ."', " .

Still no ability to create a coupon. I'm getting this error:

1146 - Table 'libidolondon_com_-_store.discount_coupons' doesn't exist

select count(*) as total from discount_coupons cd

I've asked my server to checkout this string ie: libidolondon_com_store....since that seems to be what the error keeps calling. Any other suggestions greatly appreciated.

Kelly

#26   kgt

kgt
  • Members
  • 2,883 posts
  • Real Name:KG Thorson

Posted 09 June 2006 - 15:32

I did a manual install..since I'm not fluent in sql. (wouldn't know where to begin)

I've made the suggested mods :

tep_db_input($_POST["coupons_description"]) . "', '" .
tep_db_input($_POST["coupons_discount_percent"]) ."', " .

Still no ability to create a coupon. I'm getting this error:

1146 - Table 'libidolondon_com_-_store.discount_coupons' doesn't exist

select count(*) as total from discount_coupons cd


Step 3 of the instructions tells you that you need to run two statements via phpMyAdmin (generally available via your host's control panel). You need to select your OSC database, then click the SQL tab along the top. Copy and paste the following two statements into the text area provided and click Go.

**************** STEP 2 ****************
Create the database tables

Run these statements via the SQL tab in phpMyAdmin.


CREATE TABLE discount_coupons (
coupons_id varchar(32) NOT NULL default '',
coupons_description varchar(64) NOT NULL default '',
coupons_discount_percent decimal(7,4) default NULL,
date_start datetime default NULL,
date_end datetime default NULL,
max_use int(3) NOT NULL default 0,
min_order decimal(15,4) NOT NULL default '0.0000',
PRIMARY KEY (coupons_id)
);

CREATE TABLE discount_coupons_to_orders (
discount_coupons_to_orders_id int(11) NOT NULL auto_increment,
coupons_id varchar(32) default NULL,
orders_id int(11) default '0',
PRIMARY KEY (discount_coupons_to_orders_id),
KEY coupons_id (coupons_id)
);



#27   Sigel

Sigel
  • Members
  • 53 posts
  • Real Name:SigelTEK

Posted 09 June 2006 - 15:56

Great contrib, thinking about installing it after the next update is released... one question I have is, I run the SPPC mod... will that conflict/affect it in any way?

thanks!

#28   Robomonkey3000

Robomonkey3000
  • Members
  • 2 posts
  • Real Name:Tony Rector

Posted 09 June 2006 - 16:10

Here's one I haven't seen mentioned. Thanks for this Contribution first of all. It looks like exactly what I need. Here's the problem...

Everything seems to Install fine, but when I go to Catalog> there isn't a tab for Discount Coupons. I know this must be something simple I'm overlooking. Help /wink.gif' class='bbc_emoticon' alt=';)' /> . Thanks.

#29   Sigel

Sigel
  • Members
  • 53 posts
  • Real Name:SigelTEK

Posted 09 June 2006 - 17:43

maybe you missed the boxes/catalog.php edit....

#30   Libido

Libido
  • Members
  • 11 posts
  • Real Name:Kelly Garland
  • Location:Ontario, Canada

Posted 09 June 2006 - 17:53

Step 3 of the instructions tells you that you need to run two statements via phpMyAdmin (generally available via your host's control panel). You need to select your OSC database, then click the SQL tab along the top. Copy and paste the following two statements into the text area provided and click Go.



Thanks so much KGT!!! Works like a dream now. (Just needed that SQL rock dropped on my head. /smile.gif' class='bbc_emoticon' alt=':)' />

Kelly

#31   tschreier

tschreier
  • Members
  • 5 posts
  • Real Name:Thomas Schreier

Posted 09 June 2006 - 20:07

Do you get an error? What happens?


Over SQL it works very good but, in the admin section I have just the title stay in the DB all other fields are empty in the DB.

#32   kgt

kgt
  • Members
  • 2,883 posts
  • Real Name:KG Thorson

Posted 09 June 2006 - 20:18

Great contrib, thinking about installing it after the next update is released... one question I have is, I run the SPPC mod... will that conflict/affect it in any way?


I cannot say for sure, but I strongly suspect it won't interfere at all. When you insert the code, just double check that the code specified to be replaced is exactly the same in your file as it is in the text file. Most of the code for coupon codes is purely added and doesn't replace existing code.

#33   kgt

kgt
  • Members
  • 2,883 posts
  • Real Name:KG Thorson

Posted 09 June 2006 - 20:20

Over SQL it works very good but, in the admin section I have just the title stay in the DB all other fields are empty in the DB.


Install the latest version which was uploaded today and see if that fixes it.

#34   teleute

teleute
  • Members
  • 111 posts
  • Real Name:Allison Roth

Posted 09 June 2006 - 22:45

Hi! I'm so happy to see this contribution - I've been working on something similar, but kept getting sidetracked. One odd bit of behaviour I'm noticing, though...

I've put the first coupon in and everything seems to work fine. However, if I put in an invalid code, it returns to the payment page, shows the error message as part of the URL, but does not actually display it anywhere on the screen. Any ideas? Thank you!

#35   m_ring2003

m_ring2003
  • Members
  • 51 posts
  • Real Name:Mark

Posted 10 June 2006 - 06:28

Hi,

this is a good contribution. I need a quick help though.

In Admin -> coupons.php, when I create a new Discount Coupon, the date shows is in MM/DD/YYYY.

How do I change to DD/MM/YYYY? My entire site is DD/MM/YYY. If i can mod this discount code contribution to be DD/MM/YYYY, that would be perfect.

Can someone please help n advise?

Many thanks.

#36   acastro2

acastro2
  • Members
  • 3 posts
  • Real Name:alex castro

Posted 10 June 2006 - 19:36

I had isntall this great contribution.... and seems to be working very good but some problem

the display text for "warnig" apper only on the browser address and no in the box down??? anything else it's just perfect.

besides I would like to know if there is the posibility to create coupons with fixed amount this will be nice.

thank you

#37   acastro2

acastro2
  • Members
  • 3 posts
  • Real Name:alex castro

Posted 10 June 2006 - 19:38

I had isntall this great contribution.... and seems to be working very good but with some problem

the display text for "warnig" apper only on the browser address and no in the box down??? anything else it's just perfect.

besides I would like to know if there is the posibility to create coupons with fixed amount this will be nice.

thank you

#38   acastro2

acastro2
  • Members
  • 3 posts
  • Real Name:alex castro

Posted 10 June 2006 - 19:48

I had isntall this great contribution.... and seems to be working very good but with some problem

the display text for "warnig" apper only on the browser address and no in the box down??? anything else it's just perfect.

besides I would like to know if there is the posibility to create coupons with fixed amount this will be nice.

thank you

#39   m_ring2003

m_ring2003
  • Members
  • 51 posts
  • Real Name:Mark

Posted 11 June 2006 - 00:33

Hi,

this is a good contribution. I need a quick help though.

In Admin -> coupons.php, when I create a new Discount Coupon, the date shows is in MM/DD/YYYY.

How do I change to DD/MM/YYYY? My entire site is DD/MM/YYY. If i can mod this discount code contribution to be DD/MM/YYYY, that would be perfect.

Can someone please help n advise?

Many thanks.



Hi, even if u uninstall Discount Coupon from Order total modules,.. "Do you have a promotional code or discount coupon?" still appear in checkout_payment.php?

Anyone has any ideas how to change the date format for this contribution?

many thanks

#40   mpower

mpower
  • Members
  • 3 posts
  • Real Name:Dave Verzijl
  • Location:Rotterdam, the Netherlands

Posted 11 June 2006 - 09:24

I have installed the Coupons add-on which I really love only there is a small problem; everything works fine until the shopping cart is being passed through to PayPal. There I see the price without the discount.

Do you have any idea what I'm doing wrong ? /blink.gif' class='bbc_emoticon' alt=':blink:' />