Jump to content
MWebb

Discount groups

Recommended Posts

I am trying to install Dicount groups version 1.1.1 I seem to have edited everything correctly. However when I go to to do something other than create a new group, I get this error

 

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 'and c.categories_id = g.categories_id and c.categories_id = f.categories_id orde' at line 1

 

I get different versions of these when I click on: Edit, Delete, or if I go into edit and then update.

 

I've tried using the fix in this link

 

http://forums.oscommerce.com/topic/144095-1064-you-have-an-error-in-your-sql-syntax/

 

but it doesn't solve the problem.

 

If anyone can help it would be greatly appreciated.

Share this post


Link to post
Share on other sites

Ok the error that I get after clicking edit is this:

 

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 'and c.categories_id = g.categories_id and c.categories_id = f.categories_id orde' at line 1

 

select c.discount, c.categories_id, c.customers_groups_id, g.categories_name, f.parent_id from groups_to_categories c, categories_description g, categories f where c.customers_groups_id= and c.categories_id = g.categories_id and c.categories_id = f.categories_id order by g.categories_name

 

[TEP STOP]

 

And the error I get if I click the delete button is this:

 

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 '' at line 1

 

delete from groups_to_categories where customers_groups_id=

 

[TEP STOP]

 

If I go through edit and then click update, I get this error:

 

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 'where customers_groups_id =' at line 1

 

update customers_groups set customers_groups_name='', customers_groups_discount= where customers_groups_id =

 

[TEP STOP]

 

And finally if I go through edit and then insert I get this error:

 

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 '' at line 1

 

select * from groups_to_categories where categories_id=0 and customers_groups_id=

 

[TEP STOP]

Share this post


Link to post
Share on other sites

I've also just noticed that when I log in as a customer and then click on a product (any product) I get this message.

 

1146 - Table 'oscommerce_0.TABLE_GROUPS_TO_CATEGORIES' doesn't exist

 

select discount from TABLE_GROUPS_TO_CATEGORIES where customers_groups_id = 2 and categories_id=0

 

[TEP STOP]

 

I've looked at my database and there is a table called groups_to_categories does exist

Share this post


Link to post
Share on other sites

Regarding syntax errors: Post the query as it is in the file, not the error messages just

 

Regarding last error: 1146 - Table 'oscommerce_0.TABLE_GROUPS_TO_CATEGORIES' doesn't exist

 

You don't have the table defined in includes/database_tables.php

Share this post


Link to post
Share on other sites

Think that the define may be in includes/application_top.php in this case!

 

It is an older addon are you tying to use this on a 2.3 shop??

Edited by joli1811

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

 

Share this post


Link to post
Share on other sites

HI,

 

seems to me it is this addon

 

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

 

According to the install the defines are made in application_top.php

 

Doubt very much if it would be suitable for a 2.3 shop hence the question.

 

Regards

Joli


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

 

Share this post


Link to post
Share on other sites

I don't know the add-on and yes, if instructions say that any "defines" should go to application_top.php, then it is a very old one

 

For the "define" it self: If the store has a file includes/database_tables.php and if that file is included in includes/application_top.php (as it happens in all newer stores) then you can add that define to file includes/database_tables.php, the result will be exactly same: The constant is defined.

 

OP's issue in last post is, that a constant used is not defined

Share this post


Link to post
Share on other sites

@@joli1811 Yes it is that add-on that I'm trying to use. I'm trying to get it so that I can create multiple customer groups and give each group a discount, this is the only add-on that seems to "work" for me. I've managed to fix the error regarding 1146 - Table 'oscommerce_0.TABLE_GROUPS_TO_CATEGORIES' doesn't exist

 

however

 

@@multimixer I am still getting all of the syntax errors.

 

ps I haven't logged in in a while as I've been doing other things but I'm back on this project now and I saw that you had added a bit more to the conversation so I'd thought I'd update my situation.

Share this post


Link to post
Share on other sites

I've looked at sppc and while it worked, it didn't do the discounts in percentages (unless I missed something)

Share this post


Link to post
Share on other sites

@@joli1811 If you can recommend an add-on (other than the one that I'm using) that will allow me to give discounts as a percentage (sppc doesn't seem to be able to do it) to different groups, then I would appreciate it.

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

×