- Posts: 377
- Thank you received: 7
SQL error
11 years 8 months ago #194951
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
-- 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.
Less
More
- Posts: 12953
- Thank you received: 1778
11 years 8 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 ?
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.
11 years 8 months ago #195035
by Dibben
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
Kind regards
Alex
Please Log in or Create an account to join the conversation.
11 years 8 months ago #195043
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Hi,
In the file "administrator/components/com_hikashop/classes/currency.php" please replace
By
It will fix the issue
And you also replace in the file "adminstrator/components/com_hikashop/views/discount/tmpl/form_restrictions.php"
By
It will fix the display of the categories while editing the discount.
Regards,
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));
Code:
if(!is_array($discount->discount_category_id))
$discount->discount_category_id = explode(',',trim($discount->discount_category_id, ','));
And you also replace in the file "adminstrator/components/com_hikashop/views/discount/tmpl/form_restrictions.php"
Code:
explode(',',@$this->element->discount_category_id),
Code:
explode(',', trim(@$this->element->discount_category_id, ',')),
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: Dibben, van der Veen
Please Log in or Create an account to join the conversation.
Time to create page: 0.094 seconds