SOLVED! - error 1064 when saving order variants

  • Posts: 66
  • Thank you received: 2
  • Hikashop Essential
5 years 8 months ago #296429

-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.8.11
-- PHP version -- : 7.0.31
-- Browser(s) name and version -- : Firefox for Ubuntu 61.0.1 (64 bits)
-- Error-message(debug-mod must be tuned on) -- : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND category_id = '23'' at line 1
/home/httpd/vhosts/kinntek.com/httpdocs/libraries/joomla/database/driver/mysqli.php:650


Hi!
We have an unordering drop-down for a product and it's not possible, in admin products view, to order the variants.
It wasn't a big job, I did it manually but because it's a possible bug, I come here to report.

Initial situation :


Then I click on an arrow to reorder and nothing happen, the page comes again like the screenshot.

When I modify numbers and then click above to store order, this error displays :
1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND category_id = '23'' at line 1
    /home/httpd/vhosts/kinntek.com/httpdocs/libraries/joomla/database/driver/mysqli.php:650 

Call stack
# 	Function 	Location
1 	() 	JROOT/libraries/joomla/database/driver/mysqli.php:650
2 	JDatabaseDriverMysqli->execute() 	JROOT/libraries/joomla/database/driver.php:1691
3 	JDatabaseDriver->loadObjectList() 	JROOT/administrator/components/com_hikashop/helpers/order.php:122
4 	hikashopOrderHelper->save() 	JROOT/administrator/components/com_hikashop/helpers/helper.php:1613
5 	hikashopController->saveorder() 	JROOT/administrator/components/com_hikashop/controllers/product.php:308
6 	ProductController->saveorder() 	JROOT/libraries/src/MVC/Controller/BaseController.php:710
7 	Joomla\CMS\MVC\Controller\BaseController->execute() 	JROOT/administrator/components/com_hikashop/helpers/helper.php:1753
8 	hikashopController->execute() 	JROOT/administrator/components/com_hikashop/hikashop.php:71
9 	require_once() 	JROOT/libraries/src/Component/ComponentHelper.php:382
10 	Joomla\CMS\Component\ComponentHelper::executeComponent() 	JROOT/libraries/src/Component/ComponentHelper.php:357
11 	Joomla\CMS\Component\ComponentHelper::renderComponent() 	JROOT/libraries/src/Application/AdministratorApplication.php:101
12 	Joomla\CMS\Application\AdministratorApplication->dispatch() 	JROOT/libraries/src/Application/AdministratorApplication.php:159
13 	Joomla\CMS\Application\AdministratorApplication->doExecute() 	JROOT/libraries/src/Application/CMSApplication.php:195
14 	Joomla\CMS\Application\CMSApplication->execute() 	JROOT/administrator/index.php:51

Thanks in advance for your answer.
Best regards.

Attachments:
Last edit: 5 years 8 months ago by AlainR. Reason: RESOLVED

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
5 years 8 months ago #296432

Hi,

Variantes are not directly linked to brands so ordering variants in a brand doesn't make any sense for several reasons:
- The variantes won't display on the products listing of the brand.
- Such ordering won't be used on the product page as the ordering of the characteristics, their values or the variantes on the product page is dictated by the "Characteristics values ordering" setting of the HikaShop configuration, and the ordering you would enter on your screenshot will be ignored.
- the ordering you enter in that listing is supposed to be stored in the hikashop_product_category table which links products and categories together. But there is no such link for variants so actually, the ordering should be completely disabled on that listing when you filter by something else than "products".

Now regarding the error, change the line:
if($main!=$pkey){
to:
if($main!=$pkey && count($cid)){
in that /administrator/components/com_hikashop/helpers/order.php file and that should display a proper error message.
And we'll deactivate the column for the next release when variants are being displayed.

Now I don't know why you're trying to order variants for brands as I don't see the link or in what way it would help you ?

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

  • Posts: 66
  • Thank you received: 2
  • Hikashop Essential
5 years 8 months ago #296761

Thank you very much.
Indeed, the alphabetical order of features in the configuration largely rules my problem.
I did not put an address, because there is none, the shop is in local development.
Best regards.

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

  • Posts: 66
  • Thank you received: 2
  • Hikashop Essential
5 years 8 months ago #296776

Oh no!
this does not solve my problem because XS S M L XL and XXL sizes are also in alphabetical order.
I discover "Classement" (I don't know in english) in characteristics' definition. Thank you very much!

In the order options (main Hikashop configuration), what is "Alias" ??
Thank you again for your help.

Last edit: 5 years 8 months ago by AlainR.

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

Time to create page: 0.068 seconds
Powered by Kunena Forum