Skip to main content

SQL error

More
11 years 6 months ago #194951 by Dibben
SQL error was created by Dibben
-- url of the page with the problem -- : www.houseoflights.co.uk/index.php/homeware/checkout
-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.0
-- PHP version -- : 5.4
-- Browser(s) name and version -- : Firefox
-- Error-message(debug-mod must be tuned on) -- : 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 '28,29,30,)' at line 1 SQL=SELECT category_left,category_right FROM r8zp9_hikashop_category WHERE category_id IN (,28,29,30,)

It seems when I do the discount code on the site that it kicks out an SQL error. I can publish the discount code section in the settings fine, but if i publish this discount (attached) then the SQL error occurs. Also it doesnt look like normal behavior, because i can select the categories which apply to that discount but after i have saved it removes them again.

Kind regards

Alex

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago #194964 by Mohamed Thelji
Replied by Mohamed Thelji on topic SQL error
Hello,
Can you use the "Check Database" button through the page "Hikashop->System->Configuration" and test it again ?

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago #195035 by Dibben
Replied by Dibben on topic SQL error
Sure, i did this, it said 'OK' next to all of them, i then published the discount however the problem is still there. I have unpublished again because it is a live site.

Kind regards

Alex

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago #195043 by Jerome
Replied by Jerome on topic SQL error
Hi,

In the file "administrator/components/com_hikashop/classes/currency.php" please replace
Code:
if(!is_array($discount->discount_category_id)) $discount->discount_category_id = explode(',',$discount->discount_category_id));
By
Code:
if(!is_array($discount->discount_category_id)) $discount->discount_category_id = explode(',',trim($discount->discount_category_id, ','));
It will fix the issue

And you also replace in the file "adminstrator/components/com_hikashop/views/discount/tmpl/form_restrictions.php"
Code:
explode(',',@$this->element->discount_category_id),
By
Code:
explode(',', trim(@$this->element->discount_category_id, ',')),
It will fix the display of the categories while editing the discount.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: Dibben, van der Veen

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago #195409 by Dibben
Replied by Dibben on topic SQL error
This is great thank you Jerome

Please Log in or Create an account to join the conversation.

Time to create page: 0.172 seconds
Powered by Kunena Forum