[Skip to main content](#vessel-content)

#   SQL error when adding product variants manually

##

- **[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")**
- [![iedwards's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12400-iedwards "View iedwards's Profile") Topic Author
- [ Offline](/forum/user/12400-iedwards)

Less More

- Posts: 250
- Thank you received: 7
- [](http://www.estm.co.uk)
-

13 years 2 months ago [\#121169](#121169) by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")  *[SQL error when adding product variants manually](/forum/32-content-creation/861555-sql-error-when-adding-product-variants-manually#121169 "I have encountered a couple of issues adding Variants.  1. If I switch off &quot;Generate variants automatically&quot; in advanced settings, go to a product without characteristics or variants and add characteristics to it, and then click on &quot;Manage Variants&quot; an SQL error occurs. It seems this view assumes there are always going to be variants  2. When adding characteristics to a product the multi-select checkbox at the top of the select column doesn't actually do anything, it's necessary to select characteristics individually which is a pain if you have a lot of characteristics on a lot of products (see attached capture3.jpg)  I hope you can address these two problems,  Thanks,  Ian  -- url of the page with the problem -- : not yet online -- HikaShop version -- : 2.2.1 -- Joomla version -- : 3.1.5 -- PHP version -- : 5.3.1 -- Browser(s) name and version -- : Firefox 17.0.1")* was created by *[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")*

I have encountered a couple of issues adding Variants.

1. If I switch off "Generate variants automatically" in advanced settings, go to a product without characteristics or variants and add characteristics to it, and then click on "Manage Variants" an SQL error occurs. It seems this view assumes there are always going to be variants

> 1064 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 ') ORDER BY &#96;ordering&#96; ASC' at line 1 SQL=SELECT &#96;ordering&#96;,&#96;variant\_characteristic\_id&#96;,&#96;variant\_product\_id&#96; FROM ap\_hikashop\_variant WHERE variant\_product\_id IN() ORDER BY &#96;ordering&#96; ASC

2. When adding characteristics to a product the multi-select checkbox at the top of the select column doesn't actually do anything, it's necessary to select characteristics individually which is a pain if you have a lot of characteristics on a lot of products (see attached capture3.jpg)

I hope you can address these two problems,

Thanks,

Ian

-- url of the page with the problem -- : not yet online
-- HikaShop version -- : 2.2.1
-- Joomla version -- : 3.1.5
-- PHP version -- : 5.3.1
-- Browser(s) name and version -- : Firefox 17.0.1

---

[ Ian Edwards Film Sound Recording](https://estm.co.uk)
[ Alveley Mining Heritage](https://alveleyminingheritage.org)
[ Mary Edwards-Porter - Author](https://www.mary-edwards-porter.co.uk)

- [ ![h31a6821.JPG](/forum/attachment/12009) ](/forum/attachment/12009 "h31a6821.JPG") [ ](/forum/attachment/12009?download=1 "h31a6821.JPG")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODYxNTU1LXNxbC1lcnJvci13aGVuLWFkZGluZy1wcm9kdWN0LXZhcmlhbnRzLW1hbnVhbGx5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

13 years 2 months ago [\#121259](#121259) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[SQL error when adding product variants manually](/forum/32-content-creation/861555-sql-error-when-adding-product-variants-manually#121259 "I have encountered a couple of issues adding Variants.  1. If I switch off &quot;Generate variants automatically&quot; in advanced settings, go to a product without characteristics or variants and add characteristics to it, and then click on &quot;Manage Variants&quot; an SQL error occurs. It seems this view assumes there are always going to be variants  2. When adding characteristics to a product the multi-select checkbox at the top of the select column doesn't actually do anything, it's necessary to select characteristics individually which is a pain if you have a lot of characteristics on a lot of products (see attached capture3.jpg)  I hope you can address these two problems,  Thanks,  Ian  -- url of the page with the problem -- : not yet online -- HikaShop version -- : 2.2.1 -- Joomla version -- : 3.1.5 -- PHP version -- : 5.3.1 -- Browser(s) name and version -- : Firefox 17.0.1")*

Hi,

Thank you for your feedback.

1. You can add the line:
if(!count($results)) return false;

before the line:
$query = 'SELECT &#96;ordering&#96;,&#96;variant_characteristic_id&#96;,&#96;variant_product_id&#96; FROM '.hikashop_table('variant');

in the file administrator/components/com_hikashop/classes/product.php

2. You can change the line:
&lt;input type="checkbox" name="toggle" value="" onclick="hikashop.checkAll((this);" /&gt;

to:
&lt;input type="checkbox" name="toggle" value="" onclick="hikashop.checkAll(this);" /&gt;

in the file administrator/components/com_hikashop/views/characteristic/tmpl/selectcharacteristic.php

The following user(s) said Thank You: [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODYxNTU1LXNxbC1lcnJvci13aGVuLWFkZGluZy1wcm9kdWN0LXZhcmlhbnRzLW1hbnVhbGx5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")**
- [![iedwards's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12400-iedwards "View iedwards's Profile") Topic Author
- [ Offline](/forum/user/12400-iedwards)

Less More

- Posts: 250
- Thank you received: 7
- [](http://www.estm.co.uk)
-

13 years 2 months ago [\#121283](#121283) by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")  Replied by *[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")* on topic *[SQL error when adding product variants manually](/forum/32-content-creation/861555-sql-error-when-adding-product-variants-manually#121283 "I have encountered a couple of issues adding Variants.  1. If I switch off &quot;Generate variants automatically&quot; in advanced settings, go to a product without characteristics or variants and add characteristics to it, and then click on &quot;Manage Variants&quot; an SQL error occurs. It seems this view assumes there are always going to be variants  2. When adding characteristics to a product the multi-select checkbox at the top of the select column doesn't actually do anything, it's necessary to select characteristics individually which is a pain if you have a lot of characteristics on a lot of products (see attached capture3.jpg)  I hope you can address these two problems,  Thanks,  Ian  -- url of the page with the problem -- : not yet online -- HikaShop version -- : 2.2.1 -- Joomla version -- : 3.1.5 -- PHP version -- : 5.3.1 -- Browser(s) name and version -- : Firefox 17.0.1")*

That's excellent support, thank you Nicolas. I have another question which I'll post as a new topic.

Ian

---

[ Ian Edwards Film Sound Recording](https://estm.co.uk)
[ Alveley Mining Heritage](https://alveleyminingheritage.org)
[ Mary Edwards-Porter - Author](https://www.mary-edwards-porter.co.uk)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODYxNTU1LXNxbC1lcnJvci13aGVuLWFkZGluZy1wcm9kdWN0LXZhcmlhbnRzLW1hbnVhbGx5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.065 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
