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

#   Product Export Ordering

##

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

Less More

- Posts: 9
- Thank you received: 0
-
-

14 years 10 months ago [\#32930](#32930) by [sthomas](/forum/user/3545-sthomas "View sthomas's Profile")  *[Product Export Ordering](/forum/4-how-to/32930-product-export-ordering#32930 "I'm confused about how the export of products is sorted. I would have assumed that the export would be the same as the import - our client is expoecting a CSV file with the same order/formatting...")* was created by *[sthomas](/forum/user/3545-sthomas "View sthomas's Profile")*

I'm confused about how the export of products is sorted. I would have assumed that the export would be the same as the import - our client is expoecting a CSV file with the same order/formatting (give or take the extra columns) so they can insert products into a category instead of putting them at the end.

I've looked, and it just seems random. Even the Categories seem messed up when I sort by product_id - I imported everything one category at a time and it's all over the place still. Any ideas? Is there a setting for which column sets the order for export?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMyOTMwLXByb2R1Y3QtZXhwb3J0LW9yZGVyaW5nP3RtcGw9bWFya2Rvd24=) 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: 86320
- Thank you received: 14279
-
-

14 years 10 months ago [\#32951](#32951) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Product Export Ordering](/forum/4-how-to/32930-product-export-ordering#32951 "I'm confused about how the export of products is sorted. I would have assumed that the export would be the same as the import - our client is expoecting a CSV file with the same order/formatting...")*

Hi,

It's indeed random. There is no ordering set in the query for the export so the order of the products is whatever mysql feels.
We didn't thought that it would make any difference. And no one told us that it was a problem so far so it's still like that.

If you want to have them ordered by id, you can change the line:
$query = 'SELECT * FROM '.hikashop_table('product').$where.' ORDER BY product_parent_id ASC';
to:
$query = 'SELECT * FROM '.hikashop_table('product').$where.' ORDER BY product_parent_id ASC, product_id ASC';

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

We'll do that change on our end as it makes sense to export the products in the order they were inserted.

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

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

[](#top)
