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

#   Categories Exported ID Number Not Label?

##

- **[CardOneConcepts](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile")**
- [![CardOneConcepts's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar32028.png)](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile") Topic Author
- [ Offline](/forum/user/32028-cardoneconcepts)
- We Only Do Well The Things We Love To Do!

Less More

- Posts: 35
- Thank you received: 1
-
-
- [](http://cardoneconcepts.com)
-

12 years 4 months ago [\#161809](#161809) by [CardOneConcepts](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile")  *[Categories Exported ID Number Not Label?](/forum/37-import-export-csv-xls/869269-categories-exported-id-number-not-label#161809 "url of the page with the problem -- : goldsmiths.accountsupport.com -- HikaShop version -- : HikaShop Business: 2.3.0 -- Joomla version -- : 3.3.0 -- PHP version -- : 5.3.13 -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : none  Hello,  I have an issue with the export feature and am wondering if there is anything that can be done about it.  Basically the client needs to export all the products each month and merge it with new products and then import again. And everything would be fine except that there are issues with the way the &quot;categories&quot; column data gets exported from HikaShop.  The bigger issue is that the categories I have set up have several sub categories that are the exact same name, Example:  Fine Jewelry -&gt; Gold -&gt; Rings Fine Jewelry -&gt; Silver -&gt; Rings Fine Jewelry -&gt; Colored Jem -&gt; Rings  As you can see the third level deep categories are all labeled &quot;Rings&quot;.  When setting up the import file I found that having categories labeled the same, for whatever reason screws up where the products get designated into categories when performing a product import using the category labels.  However, I did find that using the category ID numbers works well and so I have been setting up the import file with category id numbers instead of labels. The only problem with this is that when you do a product export the export file produces the categories column as labels and not category ID numbers.  In addition to making monthly mass changes to the products and performing a product import monthly, the client needs the ability to make small tweaks to products from he back-end. Which ultimately renders the last import file used inaccurate. So the need to export the products each month becomes crucial in their workflow. But as I mentioned the export file becomes an even larger confusing task becuase unless they change the &quot;Categories&quot; column in the newly exported file to reflect ID numbers, when they go to import, all the products will get placed in wrong categories.  Is there a way to alter the export functionality so it outputs the category ID numbers, instead of the category labels?")* was created by *[CardOneConcepts](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile")*

url of the page with the problem -- : goldsmiths.accountsupport.com
-- HikaShop version -- : HikaShop Business: 2.3.0
-- Joomla version -- : 3.3.0
-- PHP version -- : 5.3.13
-- Browser(s) name and version -- : all
-- Error-message(debug-mod must be tuned on) -- : none

Hello,

I have an issue with the export feature and am wondering if there is anything that can be done about it.

Basically the client needs to export all the products each month and merge it with new products and then import again. And everything would be fine except that there are issues with the way the "categories" column data gets exported from HikaShop.

The bigger issue is that the categories I have set up have several sub categories that are the exact same name, Example:

Fine Jewelry -&gt; Gold -&gt; Rings
Fine Jewelry -&gt; Silver -&gt; Rings
Fine Jewelry -&gt; Colored Jem -&gt; Rings

As you can see the third level deep categories are all labeled "Rings".

When setting up the import file I found that having categories labeled the same, for whatever reason screws up where the products get designated into categories when performing a product import using the category labels.

However, I did find that using the category ID numbers works well and so I have been setting up the import file with category id numbers instead of labels. The only problem with this is that when you do a product export the export file produces the categories column as labels and not category ID numbers.

In addition to making monthly mass changes to the products and performing a product import monthly, the client needs the ability to make small tweaks to products from he back-end. Which ultimately renders the last import file used inaccurate. So the need to export the products each month becomes crucial in their workflow. But as I mentioned the export file becomes an even larger confusing task becuase unless they change the "Categories" column in the newly exported file to reflect ID numbers, when they go to import, all the products will get placed in wrong categories.

Is there a way to alter the export functionality so it outputs the category ID numbers, instead of the category labels?

---

Thank you for your time!

Sincerely,
Brandon Cardone, Card One Concepts

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

12 years 4 months ago [\#161959](#161959) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Categories Exported ID Number Not Label?](/forum/37-import-export-csv-xls/869269-categories-exported-id-number-not-label#161959 "url of the page with the problem -- : goldsmiths.accountsupport.com -- HikaShop version -- : HikaShop Business: 2.3.0 -- Joomla version -- : 3.3.0 -- PHP version -- : 5.3.13 -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : none  Hello,  I have an issue with the export feature and am wondering if there is anything that can be done about it.  Basically the client needs to export all the products each month and merge it with new products and then import again. And everything would be fine except that there are issues with the way the &quot;categories&quot; column data gets exported from HikaShop.  The bigger issue is that the categories I have set up have several sub categories that are the exact same name, Example:  Fine Jewelry -&gt; Gold -&gt; Rings Fine Jewelry -&gt; Silver -&gt; Rings Fine Jewelry -&gt; Colored Jem -&gt; Rings  As you can see the third level deep categories are all labeled &quot;Rings&quot;.  When setting up the import file I found that having categories labeled the same, for whatever reason screws up where the products get designated into categories when performing a product import using the category labels.  However, I did find that using the category ID numbers works well and so I have been setting up the import file with category id numbers instead of labels. The only problem with this is that when you do a product export the export file produces the categories column as labels and not category ID numbers.  In addition to making monthly mass changes to the products and performing a product import monthly, the client needs the ability to make small tweaks to products from he back-end. Which ultimately renders the last import file used inaccurate. So the need to export the products each month becomes crucial in their workflow. But as I mentioned the export file becomes an even larger confusing task becuase unless they change the &quot;Categories&quot; column in the newly exported file to reflect ID numbers, when they go to import, all the products will get placed in wrong categories.  Is there a way to alter the export functionality so it outputs the category ID numbers, instead of the category labels?")*

Hi,

Yes, it's quite easy to change.
Edit the file "export" of the view "product" via the menu Display&gt;Views for your backend template and change the line: Code:

$categories[] = str_replace(array('"',',',';'), array('""','\\,','\\;'), $this-&gt;categories[$category]-&gt;category_name);

to: Code:

$categories[] = str_replace(array('"',',',';'), array('""','\\,','\\;'), $this-&gt;categories[$category]-&gt;category_id);

The following user(s) said Thank You: [CardOneConcepts](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile")

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

- **[CardOneConcepts](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile")**
- [![CardOneConcepts's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar32028.png)](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile") Topic Author
- [ Offline](/forum/user/32028-cardoneconcepts)
- We Only Do Well The Things We Love To Do!

Less More

- Posts: 35
- Thank you received: 1
-
-
- [](http://cardoneconcepts.com)
-

12 years 4 months ago -  12 years 4 months ago [\#161976](#161976) by [CardOneConcepts](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile")  Replied by *[CardOneConcepts](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile")* on topic *[Categories Exported ID Number Not Label?](/forum/37-import-export-csv-xls/869269-categories-exported-id-number-not-label#161976 "url of the page with the problem -- : goldsmiths.accountsupport.com -- HikaShop version -- : HikaShop Business: 2.3.0 -- Joomla version -- : 3.3.0 -- PHP version -- : 5.3.13 -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : none  Hello,  I have an issue with the export feature and am wondering if there is anything that can be done about it.  Basically the client needs to export all the products each month and merge it with new products and then import again. And everything would be fine except that there are issues with the way the &quot;categories&quot; column data gets exported from HikaShop.  The bigger issue is that the categories I have set up have several sub categories that are the exact same name, Example:  Fine Jewelry -&gt; Gold -&gt; Rings Fine Jewelry -&gt; Silver -&gt; Rings Fine Jewelry -&gt; Colored Jem -&gt; Rings  As you can see the third level deep categories are all labeled &quot;Rings&quot;.  When setting up the import file I found that having categories labeled the same, for whatever reason screws up where the products get designated into categories when performing a product import using the category labels.  However, I did find that using the category ID numbers works well and so I have been setting up the import file with category id numbers instead of labels. The only problem with this is that when you do a product export the export file produces the categories column as labels and not category ID numbers.  In addition to making monthly mass changes to the products and performing a product import monthly, the client needs the ability to make small tweaks to products from he back-end. Which ultimately renders the last import file used inaccurate. So the need to export the products each month becomes crucial in their workflow. But as I mentioned the export file becomes an even larger confusing task becuase unless they change the &quot;Categories&quot; column in the newly exported file to reflect ID numbers, when they go to import, all the products will get placed in wrong categories.  Is there a way to alter the export functionality so it outputs the category ID numbers, instead of the category labels?")*

Thank you so much Nicolas,

That certainly was easy!

So, I have a second part question to the export file. I was wondering if it can be solved with a tweak to the export code as well?

Basically after exporting and opening the file the first 50 lines have the category structure in them as shown in the attached screenshot. I am not really sure what this information is in the export file for becuase when you try to import those lines output errors? Perhaps it is there for adding new categories? But that will not be necessary for my situation becuase new categories will always be added manually from the back-end and then translated as category ID numbers in the import file.

It is certainly easy enough to just delete those lines in the exported spreadsheet file, but is there a way to alter the view code so it does not output this information in the export file so that when the file is opened the products start on line 2 and the category structure is not present in the file?

i ask becuase if I can remove a step for my client when they are exporting and working with the files that would be great!

Thank you for your time again!

---

Thank you for your time!

Sincerely,
Brandon Cardone, Card One Concepts

- [ ![h35346c2.png](/forum/attachment/18140) ](/forum/attachment/18140 "h35346c2.png") [ ](/forum/attachment/18140?download=1 "h35346c2.png")

Last edit: 12 years 4 months ago by [CardOneConcepts](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile").

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

12 years 4 months ago [\#162022](#162022) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Categories Exported ID Number Not Label?](/forum/37-import-export-csv-xls/869269-categories-exported-id-number-not-label#162022 "url of the page with the problem -- : goldsmiths.accountsupport.com -- HikaShop version -- : HikaShop Business: 2.3.0 -- Joomla version -- : 3.3.0 -- PHP version -- : 5.3.13 -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : none  Hello,  I have an issue with the export feature and am wondering if there is anything that can be done about it.  Basically the client needs to export all the products each month and merge it with new products and then import again. And everything would be fine except that there are issues with the way the &quot;categories&quot; column data gets exported from HikaShop.  The bigger issue is that the categories I have set up have several sub categories that are the exact same name, Example:  Fine Jewelry -&gt; Gold -&gt; Rings Fine Jewelry -&gt; Silver -&gt; Rings Fine Jewelry -&gt; Colored Jem -&gt; Rings  As you can see the third level deep categories are all labeled &quot;Rings&quot;.  When setting up the import file I found that having categories labeled the same, for whatever reason screws up where the products get designated into categories when performing a product import using the category labels.  However, I did find that using the category ID numbers works well and so I have been setting up the import file with category id numbers instead of labels. The only problem with this is that when you do a product export the export file produces the categories column as labels and not category ID numbers.  In addition to making monthly mass changes to the products and performing a product import monthly, the client needs the ability to make small tweaks to products from he back-end. Which ultimately renders the last import file used inaccurate. So the need to export the products each month becomes crucial in their workflow. But as I mentioned the export file becomes an even larger confusing task becuase unless they change the &quot;Categories&quot; column in the newly exported file to reflect ID numbers, when they go to import, all the products will get placed in wrong categories.  Is there a way to alter the export functionality so it outputs the category ID numbers, instead of the category labels?")*

Hi,

That's indeed to insert the category tree to the website so in your case you don't need that in your export.

It's actually also quite easy to remove from the export view file.
Just delete the code below in the product/export.php file : Code:

if(!empty($this-&gt;categories)) { foreach($this-&gt;categories as $category) { $data = array(); for($i = 0; $i &lt; $product_table_count; $i++) $data[] = ''; if(!empty($category-&gt;category_parent_id) &amp;&amp; isset($this-&gt;categories[$category-&gt;category_parent_id])) $data[] = $this-&gt;categories[$category-&gt;category_parent_id]-&gt;category_name; else $data[] = ''; if(!empty($category-&gt;file_path)) $data[] = $category-&gt;file_path; else $data[] = ''; $data[] = $category-&gt;category_name; for($i = 0; $i &lt; $after_category_count; $i++) $data[] = ''; $export-&gt;writeline($data); } }

The following user(s) said Thank You: [CardOneConcepts](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile")

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

- **[CardOneConcepts](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile")**
- [![CardOneConcepts's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar32028.png)](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile") Topic Author
- [ Offline](/forum/user/32028-cardoneconcepts)
- We Only Do Well The Things We Love To Do!

Less More

- Posts: 35
- Thank you received: 1
-
-
- [](http://cardoneconcepts.com)
-

12 years 4 months ago [\#162126](#162126) by [CardOneConcepts](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile")  Replied by *[CardOneConcepts](/forum/user/32028-cardoneconcepts "View CardOneConcepts's Profile")* on topic *[Categories Exported ID Number Not Label?](/forum/37-import-export-csv-xls/869269-categories-exported-id-number-not-label#162126 "url of the page with the problem -- : goldsmiths.accountsupport.com -- HikaShop version -- : HikaShop Business: 2.3.0 -- Joomla version -- : 3.3.0 -- PHP version -- : 5.3.13 -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : none  Hello,  I have an issue with the export feature and am wondering if there is anything that can be done about it.  Basically the client needs to export all the products each month and merge it with new products and then import again. And everything would be fine except that there are issues with the way the &quot;categories&quot; column data gets exported from HikaShop.  The bigger issue is that the categories I have set up have several sub categories that are the exact same name, Example:  Fine Jewelry -&gt; Gold -&gt; Rings Fine Jewelry -&gt; Silver -&gt; Rings Fine Jewelry -&gt; Colored Jem -&gt; Rings  As you can see the third level deep categories are all labeled &quot;Rings&quot;.  When setting up the import file I found that having categories labeled the same, for whatever reason screws up where the products get designated into categories when performing a product import using the category labels.  However, I did find that using the category ID numbers works well and so I have been setting up the import file with category id numbers instead of labels. The only problem with this is that when you do a product export the export file produces the categories column as labels and not category ID numbers.  In addition to making monthly mass changes to the products and performing a product import monthly, the client needs the ability to make small tweaks to products from he back-end. Which ultimately renders the last import file used inaccurate. So the need to export the products each month becomes crucial in their workflow. But as I mentioned the export file becomes an even larger confusing task becuase unless they change the &quot;Categories&quot; column in the newly exported file to reflect ID numbers, when they go to import, all the products will get placed in wrong categories.  Is there a way to alter the export functionality so it outputs the category ID numbers, instead of the category labels?")*

Thank you again Nicolas!!!

That did the trick!

---

Thank you for your time!

Sincerely,
Brandon Cardone, Card One Concepts

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

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