SQL error

  • Posts: 377
  • Thank you received: 7
9 years 8 months ago #194951

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

Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
9 years 8 months ago #194964

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.

  • Posts: 377
  • Thank you received: 7
9 years 8 months ago #195035

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.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 8 months ago #195043

Hi,

In the file "administrator/components/com_hikashop/classes/currency.php" please replace

if(!is_array($discount->discount_category_id)) $discount->discount_category_id = explode(',',$discount->discount_category_id));
By
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"
explode(',',@$this->element->discount_category_id),
By
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.

  • Posts: 377
  • Thank you received: 7
9 years 8 months ago #195409

This is great thank you Jerome

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

Time to create page: 0.070 seconds
Powered by Kunena Forum