Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Admin Specials by Category


bruyndoncx

Recommended Posts

This contribution allows you to:

* List products (alphabetically) for selected category displaying the special price and implied discount

* Add a % discount to all products in selected category

* Add, change or remove a special price for an individual product in the selected category

 

It is multilangual, conforming to osCommerce TABLE conventions and only makes

changes in the admin.

 

This is an easy install, just a few files to edit and load of main php and language

files.

 

It is based on the specials admin contribution (206)

 

Demo with screenshots included in the package

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

  • Replies 134
  • Created
  • Last Reply

Top Posters In This Topic

Very good job but i have problems:

 

Add discounts:

 

1064 - You have an error in your SQL syntax near '; ' at line 1

 

Insert into specials (products_id, specials_new_products_price) values (6624, '743.9803');

 

[TEP STOP]

 

The query sintax "Insert into specials (products_id, specials_new_products_price) values (6624, '743.9803');" is ok.

 

Thanks

 

 

 

This contribution allows you to:

* List products (alphabetically) for selected category displaying the special price and implied discount

* Add a % discount to all products in selected category

* Add, change or remove a special price for an individual product in the selected category

 

It is multilangual, conforming to osCommerce TABLE conventions and only makes

changes in the admin.

 

This is an easy install, just a few files to edit and load of main php and language

files.

 

It is based on the specials admin contribution (206)

 

Demo with screenshots included in the package

Link to comment
Share on other sites

Another error:

 

manual change price update:

 

1136 - Column count doesn't match value count at row 1

 

INSERT INTO specials VALUES ('','4932','31.0000','2005-04-30 18:35:28','','','','1');

 

[TEP STOP]

 

 

 

Very good job but i have problems:

 

Add discounts:

 

1064 - You have an error in your SQL syntax near '; ' at line 1

 

Insert into specials (products_id, specials_new_products_price) values (6624, '743.9803');

 

[TEP STOP]

 

The query sintax "Insert into specials (products_id, specials_new_products_price) values (6624, '743.9803');"  is ok.

 

Thanks

Link to comment
Share on other sites

Could it be that you customized the specials section and added another contribution that adds extra columns to the specials table ?

 

Could you go into phpmyadmin and display the table structure and copy it here ?

 

Thx

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Hello

 

specials_id int(11) No auto_increment

products_id int(11) No 0

specials_new_products_price decimal(15,4) No 0.0000

specials_date_added datetime S? NULL

specials_last_modified datetime S? NULL

expires_date datetime S? NULL

date_status_change datetime S? NULL

status int(1) No 1

customers_group_id int(11) No 0

 

 

Thanks.

:D

 

Could it be that you customized the specials section and added another contribution that adds extra columns to the specials table ?

 

Could you go into phpmyadmin and display the table structure and copy it here ?

 

Thx

Link to comment
Share on other sites

Well, yes, you have a contribution installed that modified your specials.

I'm guessing it's a B2B suite. :D

 

it looks like you have to add the 'customers_group_id' field to the list of fields with the value set to '0', exactly in the places where you got the error just to make it work. Customer group '0' if I remember well is general retail, or no specific customer group discount.

 

I'm not sure what other changes you find in the specials pages in the B2B suite that would modify the default specials behaviour for the B2B.

 

Alternatively, you'd have to execute these same set of sql commands for each customer group id if you want to carry these through for all customer groups.

 

Hope I'm talking sense here ... the choice is essentially yours.

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Yes is that B2B contrib, i?m not a programer only cut & paste... :'( but the SQL result ejects ok on mysqladmin, i need a little help.

 

Sorry for my English i?m Spanish.

 

www.scrinf.com

 

Thanks

 

 

Well, yes, you have a contribution installed that modified your specials.

I'm guessing it's a B2B suite. :D

 

it looks like you have to add the 'customers_group_id' field to the list of fields with the value set to '0', exactly in the places where you got the error just to make it work. Customer group '0' if I remember well is general retail, or no specific customer group discount.

 

I'm not sure what other changes you find in the specials pages in the B2B suite that would modify the default specials behaviour for the B2B.

 

Alternatively, you'd have to execute these same set of sql commands for each customer group id if you want to carry these through for all customer groups.

 

Hope I'm talking sense here ... the choice is essentially yours.

Link to comment
Share on other sites

Sergio

 

With B2B you have different customer groups and prices.

As far as I understand this is true for specials as well.

 

My contribution only works with a single special price.

 

The question is really how should my contribution behave when you have multiple customer groups.

 

You have not answered that question.

 

This is not about having an easy fix, but really adapting my contribution to work with B2B. I do not have any test site for B2B, nor enough insight in the general working of this contribution to be able to estimate the work involved..

 

Have you asked for support on the B2B thread ?

 

Carine

 

Carine

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Hello Carine, the groups is not the problem because is based on a % from the single price, i think on the sql sentences.

 

Thanks.

 

Sergio

 

With B2B you have different customer groups and prices.

As far as I understand this is true for specials as well.

 

My contribution only works with a single special price.

 

The question is really how should my contribution behave when you have multiple customer groups.

 

You have not answered that question.

 

This is not about having an easy fix, but really adapting my contribution to work with B2B. I do not have any test site for B2B, nor enough insight in the general working of this contribution to be able to estimate the work involved..

 

Have you asked for support on the B2B thread ?

 

Carine

 

Carine

Link to comment
Share on other sites

  • 2 weeks later...

I'm getting the same error. I have made no alterations to the way specials work. All I did was install the contribution and got this error when I first attempted to change percentages.

 

Please help! Shop has to be ready soon!

 

Thanks a lot!

 

Very good job but i have problems:

 

Add discounts:

 

1064 - You have an error in your SQL syntax near '; ' at line 1

 

Insert into specials (products_id, specials_new_products_price) values (6624, '743.9803');

 

[TEP STOP]

 

The query sintax "Insert into specials (products_id, specials_new_products_price) values (6624, '743.9803');"  is ok.

 

Thanks

Link to comment
Share on other sites

does your specials table have the same set of colums like sergio's ?

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

what happens if you run the sql interactively in phpmyadmin ?

if error, try without the ';' at the end

if still error, try without the single quotes around the number

if still error, do you use comma as decimal separator ?

 

that's all I can think of ...

 

You do have default values for all other mandatory columns - right ?

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Hi :)

 

the same problem, I can't manage it :(

1064 - You have an error in your SQL syntax near '; ' at line 1

 

Insert into specials (products_id, specials_new_products_price) values (2226, '20.286882');

 

[TEP STOP]

 

my tables:

   specials_id  int(11)    No    auto_increment              
  products_id  int(11)   No  0                
  specials_new_products_price  decimal(15,4)   No  0.0000                
  specials_date_added  datetime   Yes  NULL                
  specials_last_modified  datetime   Yes  NULL                
  expires_date  datetime   Yes  NULL                
  date_status_change  datetime   Yes  NULL                
  status  int(1)   No  1  

 

PLEASE HELP ME !!! :blink:

 

PS

I made Polish translation = do you wish to add my language file??

Link to comment
Share on other sites

I tried running the sql (e.g. Insert into specials (products_id, specials_new_products_price) values (30, '5.373'); ) interactively and here's what happened:

 

- When changing a category do 10% discount, either one or two products changed to 9% discount. The other products in the category remained without any discount.

 

- When changing a category to 20% discount, one product would change to 20% discount, the others, again, remaining in their no-discount state.

 

So, I don't get an error when I run the sql on phpmyadmin, but something isn't quite working.

 

Anywhere nearer to finding out?

 

Thanks again.

 

what happens if you run the sql interactively in phpmyadmin ?

if error, try without the ';' at the end

if still error, try without the single quotes around the number

if still error, do you use comma as decimal separator ?

 

that's all I can think of ...

 

You do have default values for all other mandatory columns - right ?

Link to comment
Share on other sites

Sorry, forgot one thing:

 

I don't have a default value for "specials_id". And all the date related ones have a default of "NULL".

 

Just to let you know.

 

I tried running the sql (e.g. Insert into specials (products_id, specials_new_products_price) values (30, '5.373'); ) interactively and here's what happened:

 

- When changing a category do 10% discount, either one or two products changed to 9% discount. The other products in the category remained without any discount.

 

- When changing a category to 20% discount, one product would change to 20% discount, the others, again, remaining in their no-discount state.

 

So, I don't get an error when I run the sql on phpmyadmin, but something isn't quite working.

 

Anywhere nearer to finding out?

 

Thanks again.

Link to comment
Share on other sites

I tried running the sql (e.g. Insert into specials (products_id, specials_new_products_price) values (30, '5.373'); ) interactively and here's what happened:

 

- When changing a category do 10% discount, either one or two products changed to 9% discount. The other products in the category remained without any discount.

 

- When changing a category to 20% discount, one product would change to 20% discount, the others, again, remaining in their no-discount state.

 

So, I don't get an error when I run the sql on phpmyadmin, but something isn't quite working.

 

Anywhere nearer to finding out?

 

Thanks again.

I'm working with garret trying to troubleshoot this situation ... stay tuned ...

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Sorry, forgot one thing:

 

I don't have a default value for "specials_id". And all the date related ones have a default of "NULL".

 

Just to let you know.

Specials_id has an autoincrement set, so a new id is generated upon insertion. Thus it acts as a default, though a different incremental number each time.

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

working with gerrit, his problem was solved by removing the ';' at the end of the sql string on line 120 and 123 in the code.

 

Could you all try the same and let me know if this fixed it ?

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

... new working version with Polish translation was send to bruyndoncx

 

Please remember to clear cache at your shop

after changing files otherwise .... it seems not working B)

 

best regards

 

thx bruyndoncx for kind work together :thumbsup:

Link to comment
Share on other sites

Great! My problem is solved! Taking the ; from the two sql strings dit it.

 

Thanks a lot for your help and good luck with your future contributions!

 

All the best!

 

working with gerrit, his problem was solved by removing the ';' at the end of the sql string on line 120 and 123 in the code.

 

Could you all try the same and let me know if this fixed it ?

Link to comment
Share on other sites

Another issue:

 

When trying to update a price of an already discounted product in a category I also got an error, similar to the one I was first getting.

 

I solved it getting rid of the ";" in the sql string on line 73 of the file.

 

Just to let you know.

Link to comment
Share on other sites

  • 2 weeks later...

Dear bruyndoncx,

 

Thank you very much for your contribution.

 

I am new in mysql and php. When I used your contribution I got the following error :

 

1064 - You have an error in your SQL syntax near '; ' at line 1

 

Insert into specials (products_id, specials_new_products_price) values (1, '9.303');

 

[TEP STOP]

 

 

Could you please tell me how to solve this .

Link to comment
Share on other sites

Dear bruyndoncx,

 

Thank you very much for your contribution.

 

I am new in mysql and php. When I used your contribution I got the following error :

 

1064 - You have an error in your SQL syntax near '; ' at line 1

 

Insert into specials (products_id, specials_new_products_price) values (1, '9.303');

 

[TEP STOP]

Could you please tell me how to solve this .

If you read from post #2 in this thread on, you will see the fix at post #19, as 4 other people had the same issue. Usually, if you search for an answer to your question BEFORE posting, that is considered good netiquette. I can understand re-asking the same question in a thread with 50 pages, but in a thread that has 2? :rolleyes:

 

More specifically, your questions were already answered in this post here.

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