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

#   Product options changing order

##

- **[Sheldon](/forum/user/35992-sheldon "View Sheldon's Profile")**
- [![Sheldon's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/time_eye.jpg)](/forum/user/35992-sheldon "View Sheldon's Profile") Topic Author
- [ Offline](/forum/user/35992-sheldon)

Less More

- Posts: 17
- Thank you received: 0
-
-

9 years 5 months ago -  9 years 5 months ago [\#269224](#269224) by [Sheldon](/forum/user/35992-sheldon "View Sheldon's Profile")  *[Product options changing order](/forum/25-install-update/890190-product-options-changing-order#269224 "-- HikaShop version -- : 3.7 -- Joomla version -- : 3.6.5  On a few of our products we use Options with characteristics to allow customers to configure final product. To create the order the options appear as on the product page we can drag and drop the options in the backend product window then save.  Problem: Once saved the list reverts back to the numbered order of the options. So if you go in and make a change the option list order changes as well unless you resort them every time before you hit save.    view.xscreenshot.com/725581f60efe4d6c9afd04b099b2f6d4  Have tried a few things but cant get the ordering to &quot;stick&quot; through a product save. Any help?  Cheers")* was created by *[Sheldon](/forum/user/35992-sheldon "View Sheldon's Profile")*

-- HikaShop version -- : 3.7
-- Joomla version -- : 3.6.5

On a few of our products we use Options with characteristics to allow customers to configure final product.
To create the order the options appear as on the product page we can drag and drop the options in the backend product window then save.

Problem: Once saved the list reverts back to the numbered order of the options. So if you go in and make a change the option list order changes as well unless you resort them every time before you hit save.

[ view.xscreenshot.com/725581f60efe4d6c9afd04b099b2f6d4](http://view.xscreenshot.com/725581f60efe4d6c9afd04b099b2f6d4)

Have tried a few things but cant get the ordering to "stick" through a product save. Any help?

Cheers

Last edit: 9 years 5 months ago by [Sheldon](/forum/user/35992-sheldon "View Sheldon's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg5MDE5MC1wcm9kdWN0LW9wdGlvbnMtY2hhbmdpbmctb3JkZXI/dG1wbD1tYXJrZG93bg==) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

9 years 5 months ago [\#269259](#269259) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Product options changing order](/forum/25-install-update/890190-product-options-changing-order#269259 "-- HikaShop version -- : 3.7 -- Joomla version -- : 3.6.5  On a few of our products we use Options with characteristics to allow customers to configure final product. To create the order the options appear as on the product page we can drag and drop the options in the backend product window then save.  Problem: Once saved the list reverts back to the numbered order of the options. So if you go in and make a change the option list order changes as well unless you resort them every time before you hit save.    view.xscreenshot.com/725581f60efe4d6c9afd04b099b2f6d4  Have tried a few things but cant get the ordering to &quot;stick&quot; through a product save. Any help?  Cheers")*

Hi,

I'm not able to reproduce the problem on my end with the 3.0.1 version of HikaShop (note that the 3.7 version doesn't exist yet so I'm not sure which version you're actually using, or if you're coming from the future ![:p](/media/kunena/emoticons/16.png ":p")) and I don't remember anyone pointing at a bug there, at least in the last few years.
So I guess it will require more tests from you.
If you try with another browser, does it work ?
Do you have any javascript error on the page (you can see them with the javascript console of your browser) ?
Do you use a WYSIWYG editor different than the default one (TinyMCE) ? If you switch to the default one, does that help ?
Did you configure any mass action in the menu System&gt;Mass actions ? They can potentially mess with the saving process.
Do you have any custom plugin on your website ?

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

- **[Sheldon](/forum/user/35992-sheldon "View Sheldon's Profile")**
- [![Sheldon's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/time_eye.jpg)](/forum/user/35992-sheldon "View Sheldon's Profile") Topic Author
- [ Offline](/forum/user/35992-sheldon)

Less More

- Posts: 17
- Thank you received: 0
-
-

9 years 5 months ago [\#269317](#269317) by [Sheldon](/forum/user/35992-sheldon "View Sheldon's Profile")  Replied by *[Sheldon](/forum/user/35992-sheldon "View Sheldon's Profile")* on topic *[Product options changing order](/forum/25-install-update/890190-product-options-changing-order#269317 "-- HikaShop version -- : 3.7 -- Joomla version -- : 3.6.5  On a few of our products we use Options with characteristics to allow customers to configure final product. To create the order the options appear as on the product page we can drag and drop the options in the backend product window then save.  Problem: Once saved the list reverts back to the numbered order of the options. So if you go in and make a change the option list order changes as well unless you resort them every time before you hit save.    view.xscreenshot.com/725581f60efe4d6c9afd04b099b2f6d4  Have tried a few things but cant get the ordering to &quot;stick&quot; through a product save. Any help?  Cheers")*

Your right! Joomla 3.6.5/hikashop 3.0.1
Tried firefox and chrome and IE, all the same results .I did have to change the order of the products to enable them to be displayed in the preferred list order...
I will talk with my excellent developer and see what he thinks...

Thank you for your kind and timely response Nicolas!
(Sent to you from the future ![:o](/media/kunena/emoticons/23.png ":o"))

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

- **[remotelyyours](/forum/user/27477-remotelyyours "View remotelyyours's Profile")**
- [![remotelyyours's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar27477.png)](/forum/user/27477-remotelyyours "View remotelyyours's Profile")
- [ Offline](/forum/user/27477-remotelyyours)

Less More

- Posts: 28
- Thank you received: 3
-
-

9 years 5 months ago [\#269415](#269415) by [remotelyyours](/forum/user/27477-remotelyyours "View remotelyyours's Profile")  Replied by *[remotelyyours](/forum/user/27477-remotelyyours "View remotelyyours's Profile")* on topic *[Product options changing order](/forum/25-install-update/890190-product-options-changing-order#269415 "-- HikaShop version -- : 3.7 -- Joomla version -- : 3.6.5  On a few of our products we use Options with characteristics to allow customers to configure final product. To create the order the options appear as on the product page we can drag and drop the options in the backend product window then save.  Problem: Once saved the list reverts back to the numbered order of the options. So if you go in and make a change the option list order changes as well unless you resort them every time before you hit save.    view.xscreenshot.com/725581f60efe4d6c9afd04b099b2f6d4  Have tried a few things but cant get the ordering to &quot;stick&quot; through a product save. Any help?  Cheers")*

Hi. Here is the problem in a more detailed way.

Before I press save I add an option
[ ![600](http://static.xscreenshot.com/2017/05/13/17/screen_32d207f71b6ffb08ebd42b5437733c91) ](http://view.xscreenshot.com/32d207f71b6ffb08ebd42b5437733c91)

After I press save - I check my DB
[ ![600](http://static.xscreenshot.com/2017/05/13/17/screen_22049191c9007671e946785f7c1580f0) ](http://view.xscreenshot.com/22049191c9007671e946785f7c1580f0)

When I edit the product after it, the option is not at the bottom of the list, but is at the top. So when I save the product for the second time - it's saved in the new order.
[ ![600](http://static.xscreenshot.com/2017/05/13/17/screen_4d38fc1f902212d048a04e18c4508699) ](http://view.xscreenshot.com/4d38fc1f902212d048a04e18c4508699)

And here is the place where the things a broken.
So let's assume I'v just added the option to the bottom of the list, it's saved and I open my product to edit it.
In **administrator/components/com\_hikashop/views/product/tmpl/form.php;414** HS code Code:

echo $this-&gt;nameboxType-&gt;display( 'data[product][options]', @$this-&gt;product-&gt;options, hikashopNameboxType::NAMEBOX_MULTIPLE, 'product', array( 'delete' =&gt; true, 'sort' =&gt; true, 'default_text' =&gt; '&lt;em&gt;'.JText::_('HIKA_NONE').'&lt;/em&gt;', ) );

returns the list disregarding **product\_related\_ordering** field from the DB. So my option is returned at the top of the list.

The problem is in **administrator/components/com\_hikashop/classes/product.php** line about 3570.

The code place is here: Code:

$filter = array(); foreach($value as $v) { $filter[] = (int)$v; } $query = 'SELECT p.* '. ' FROM ' . hikashop_table('product') . ' AS p ' . ' WHERE p.product_id IN ('.implode(',', $filter).') '; $this-&gt;db-&gt;setQuery($query); $products = $this-&gt;db-&gt;loadObjectList('product_id');

So **$filter** array still contains the correct ordering (my option id at the bottom), but after the DB query **$products** contains ordered by **product\_id** objects.

[ ![600](http://static.xscreenshot.com/2017/05/13/17/screen_5abeb25aa44907373160a00297a28fbf) ](http://view.xscreenshot.com/5abeb25aa44907373160a00297a28fbf)

So my solution is to reorder the **$products** after being got from the DB
So I'd replace code in line 3570 Code:

$products = $this-&gt;db-&gt;loadObjectList('product_id');

with Code:

$products_tmp = $this-&gt;db-&gt;loadObjectList('product_id'); $products = []; foreach ($filter as $pid) { if (isset($products_tmp[$pid])) { $products[$pid] = $products_tmp[$pid]; } }

The following user(s) said Thank You: [nicolas](/forum/user/63-nicolas "View nicolas's Profile"), [Jerome](/forum/user/80-jerome "View Jerome's Profile"), [nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")

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

- **[nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")**
- [![nico.van.leeuwen's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar_2012-12-17-2.jpg)](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")
- [ Offline](/forum/user/12404-nico-van-leeuwen)

Less More

- Posts: 341
- Thank you received: 27
-
-
- [](http://www.delinie-ict.nl)
-

9 years 5 months ago [\#269439](#269439) by [nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")  Replied by *[nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")* on topic *[Product options changing order](/forum/25-install-update/890190-product-options-changing-order#269439 "-- HikaShop version -- : 3.7 -- Joomla version -- : 3.6.5  On a few of our products we use Options with characteristics to allow customers to configure final product. To create the order the options appear as on the product page we can drag and drop the options in the backend product window then save.  Problem: Once saved the list reverts back to the numbered order of the options. So if you go in and make a change the option list order changes as well unless you resort them every time before you hit save.    view.xscreenshot.com/725581f60efe4d6c9afd04b099b2f6d4  Have tried a few things but cant get the ordering to &quot;stick&quot; through a product save. Any help?  Cheers")*

Hi everybody,

I can confirm this issue in my website (Joomla 3.7.0 with Hikashop 3.0.1).

Thank you remotelyyours for the great explanation.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg5MDE5MC1wcm9kdWN0LW9wdGlvbnMtY2hhbmdpbmctb3JkZXI/dG1wbD1tYXJrZG93bg==) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

9 years 5 months ago [\#269452](#269452) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Product options changing order](/forum/25-install-update/890190-product-options-changing-order#269452 "-- HikaShop version -- : 3.7 -- Joomla version -- : 3.6.5  On a few of our products we use Options with characteristics to allow customers to configure final product. To create the order the options appear as on the product page we can drag and drop the options in the backend product window then save.  Problem: Once saved the list reverts back to the numbered order of the options. So if you go in and make a change the option list order changes as well unless you resort them every time before you hit save.    view.xscreenshot.com/725581f60efe4d6c9afd04b099b2f6d4  Have tried a few things but cant get the ordering to &quot;stick&quot; through a product save. Any help?  Cheers")*

Hi,

@remotelyyours :
Thank you !
That was indeed a great help.
I've added the patch on our end.

@nico.van.leeuwen :
We've added the patch on our end. You can either apply what @remotelyyours proposed or download the install package on our website and install it on yours to get the fix.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg5MDE5MC1wcm9kdWN0LW9wdGlvbnMtY2hhbmdpbmctb3JkZXI/dG1wbD1tYXJrZG93bg==) 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.215 seconds

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

[](#top)
