Jump to content

Installing Discount Code into oscommerce site syntax error


Recommended Posts

Hi All

 

Please forgive me is I'm new to this and learning slowly as I go.. I'm trying to install a code I downloaded from oscommerce and put into my site.

 

I have followed the instructions but have come up with this error whilst trying to paste it into SQL in myPHPadmin

 

#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 'CREATE TABLE `discount_codes` ( `discount_codes_id` int(11) NOT NULL auto_inc' at line 7

 

 

This is the query I was pasting:

 

CREATE TABLE `customers_to_discount_codes` (

  `customers_id` int(11) NOT NULL default '0',

  `discount_codes_id` int(11) NOT NULL default '0',

  KEY `customers_id` (`customers_id`),

  KEY `discount_codes_id` (`discount_codes_id`)

)

CREATE TABLE `discount_codes` (

  `discount_codes_id` int(11) NOT NULL auto_increment,

  `products_id` text,

  `categories_id` text,

  `manufacturers_id` text,

  `excluded_products_id` text,

  `customers_id` text,

  `orders_total` tinyint(1) NOT NULL default '0',

  `order_info` tinyint(1) NOT NULL default '0',

  `discount_codes` varchar(8) NOT NULL default '',

  `discount_values` varchar(8) NOT NULL default '',

  `minimum_order_amount` decimal(15,4) NOT NULL default '0.0000',

  `expires_date` date NOT NULL default '0000-00-00',

  `number_of_orders` int(4) NOT NULL default '0',

  `number_of_use` int(4) NOT NULL default '0',

  `number_of_products` int(4) NOT NULL default '0',

  `status` tinyint(1) NOT NULL default '1',

  PRIMARY KEY  (`discount_codes_id`)

)

 

I feel I've googled all the help I can get but not getting anywhere! Is anyone able to assist me?

 

Thanks in advance :)

Your missing the closing ; around your first query.

 

eg; this

CREATE TABLE `customers_to_discount_codes` (
  `customers_id` int(11) NOT NULL default '0',
  `discount_codes_id` int(11) NOT NULL default '0',
  KEY `customers_id` (`customers_id`),
  KEY `discount_codes_id` (`discount_codes_id`)
)

 

should be...

 

CREATE TABLE `customers_to_discount_codes` (
  `customers_id` int(11) NOT NULL default '0',
  `discount_codes_id` int(11) NOT NULL default '0',
  KEY `customers_id` (`customers_id`),
  KEY `discount_codes_id` (`discount_codes_id`)
);

And just to be a pain... do you know what this means when its says copy the files to the oscommerce shop?

 

2. Copy the new files from the catalog/ folder to your osCommerce shop:

catalog/includes/modules/order_total/ot_discount.php

catalog/includes/languages/english/modules/order_total/ot_discount.php

catalog/admin/discount_codes.php

catalog/admin/includes/languages/english/discount_codes.php

catalog/admin/includes/languages/english/images/buttons/button_new_discount_code.gif

It clicked right after I sent that!

 

Have gotten it all done but now as trying to install the module I get this error message..

Fatal error: Cannot redeclare class ot_discount in /home/flishclo/public_html/includes/modules/order_total/ot_discount.php on line 16

 

 

 

Any ideas?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.