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

#   SOLVED: Bulk Create Product Category Rows

##

- **[tony@10uk.net](/forum/user/6276-tony-10uk-net "View tony@10uk.net's Profile")**
- [![tony@10uk.net's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6276-tony-10uk-net "View tony@10uk.net's Profile") Topic Author
- [ Offline](/forum/user/6276-tony-10uk-net)

Less More

- Posts: 127
- Thank you received: 12
-
-

13 years 1 day ago -  13 years 9 hours ago [\#134093](#134093) by [tony@10uk.net](/forum/user/6276-tony-10uk-net "View tony@10uk.net's Profile")  *[SOLVED: Bulk Create Product Category Rows](/forum/32-content-creation/863903-solved-bulk-create-product-category-rows#134093 "-- url of the page with the problem -- : not required -- HikaShop version -- : 1.5.7 -- Joomla version -- : 1.7 -- PHP version -- : not required -- Browser(s) name and version -- : not required -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hello,  I wish to add many products (1000s) into a new category. That category will be applied to a discount code.  I have two options:  1) Spend a long time using the backend to update the relevant products with the new category.  2) Bulk change the database.  I wish to do the second of these.  Looking at the database, there are three tables: - Category - Product - Product Category  It seems to me that Product Category is an m:n resolver between the other two tables.  My plan is to simply insert rows into Product Category combining the relevant Category IDs and Product IDs and allowing the primary key to auto increment.  This seems quite straight forward.  My question is... Are there any other tables involved? Will this work? Do you envisage any problems by doing this?  Many thanks,  Tony")* was created by *[tony@10uk.net](/forum/user/6276-tony-10uk-net "View tony@10uk.net's Profile")*

-- url of the page with the problem -- : not required
-- HikaShop version -- : 1.5.7
-- Joomla version -- : 1.7
-- PHP version -- : not required
-- Browser(s) name and version -- : not required
-- Error-message(debug-mod must be tuned on) -- : Error_message

Hello,

I wish to add many products (1000s) into a new category. That category will be applied to a discount code.

I have two options:

1) Spend a long time using the backend to update the relevant products with the new category.

2) Bulk change the database.

I wish to do the second of these.

Looking at the database, there are three tables:
- Category
- Product
- Product Category

It seems to me that Product Category is an m:n resolver between the other two tables.

My plan is to simply insert rows into Product Category combining the relevant Category IDs and Product IDs and allowing the primary key to auto increment.

This seems quite straight forward.

My question is... Are there any other tables involved? Will this work? Do you envisage any problems by doing this?

Many thanks,

Tony

Last edit: 13 years 9 hours ago by [tony@10uk.net](/forum/user/6276-tony-10uk-net "View tony@10uk.net's Profile").

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

13 years 1 day ago [\#134123](#134123) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Bulk Create Product Category Rows](/forum/32-content-creation/863903-solved-bulk-create-product-category-rows#134123 "-- url of the page with the problem -- : not required -- HikaShop version -- : 1.5.7 -- Joomla version -- : 1.7 -- PHP version -- : not required -- Browser(s) name and version -- : not required -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hello,  I wish to add many products (1000s) into a new category. That category will be applied to a discount code.  I have two options:  1) Spend a long time using the backend to update the relevant products with the new category.  2) Bulk change the database.  I wish to do the second of these.  Looking at the database, there are three tables: - Category - Product - Product Category  It seems to me that Product Category is an m:n resolver between the other two tables.  My plan is to simply insert rows into Product Category combining the relevant Category IDs and Product IDs and allowing the primary key to auto increment.  This seems quite straight forward.  My question is... Are there any other tables involved? Will this work? Do you envisage any problems by doing this?  Many thanks,  Tony")*

Hi Tony,

Note that another solution can be to :
- Create some products manually
- Export them through the **EXPORT** button of the page "*Hikashop-&gt;Products*"
- Add your product through this exported CSV file
- Import it

Doing it through Hikashop SQL tables won't be that easy, for example regarding your product price you'll also have to add your price through the "**hikashop\_price**" table.

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

- **[tony@10uk.net](/forum/user/6276-tony-10uk-net "View tony@10uk.net's Profile")**
- [![tony@10uk.net's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6276-tony-10uk-net "View tony@10uk.net's Profile") Topic Author
- [ Offline](/forum/user/6276-tony-10uk-net)

Less More

- Posts: 127
- Thank you received: 12
-
-

13 years 1 day ago [\#134137](#134137) by [tony@10uk.net](/forum/user/6276-tony-10uk-net "View tony@10uk.net's Profile")  Replied by *[tony@10uk.net](/forum/user/6276-tony-10uk-net "View tony@10uk.net's Profile")* on topic *[Bulk Create Product Category Rows](/forum/32-content-creation/863903-solved-bulk-create-product-category-rows#134137 "-- url of the page with the problem -- : not required -- HikaShop version -- : 1.5.7 -- Joomla version -- : 1.7 -- PHP version -- : not required -- Browser(s) name and version -- : not required -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hello,  I wish to add many products (1000s) into a new category. That category will be applied to a discount code.  I have two options:  1) Spend a long time using the backend to update the relevant products with the new category.  2) Bulk change the database.  I wish to do the second of these.  Looking at the database, there are three tables: - Category - Product - Product Category  It seems to me that Product Category is an m:n resolver between the other two tables.  My plan is to simply insert rows into Product Category combining the relevant Category IDs and Product IDs and allowing the primary key to auto increment.  This seems quite straight forward.  My question is... Are there any other tables involved? Will this work? Do you envisage any problems by doing this?  Many thanks,  Tony")*

Thank you for your post, but I don't think you have understood my question.

My Products exist.

My Category exists.

Let me phrase the question differently:

If I use the Hikashop backend to asign a Category to a Product, what database rows are created/updated?

Is it JUST Product_Category?

Tony

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

13 years 22 hours ago [\#134198](#134198) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Bulk Create Product Category Rows](/forum/32-content-creation/863903-solved-bulk-create-product-category-rows#134198 "-- url of the page with the problem -- : not required -- HikaShop version -- : 1.5.7 -- Joomla version -- : 1.7 -- PHP version -- : not required -- Browser(s) name and version -- : not required -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hello,  I wish to add many products (1000s) into a new category. That category will be applied to a discount code.  I have two options:  1) Spend a long time using the backend to update the relevant products with the new category.  2) Bulk change the database.  I wish to do the second of these.  Looking at the database, there are three tables: - Category - Product - Product Category  It seems to me that Product Category is an m:n resolver between the other two tables.  My plan is to simply insert rows into Product Category combining the relevant Category IDs and Product IDs and allowing the primary key to auto increment.  This seems quite straight forward.  My question is... Are there any other tables involved? Will this work? Do you envisage any problems by doing this?  Many thanks,  Tony")*

Yes, just this one.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[tony@10uk.net](/forum/user/6276-tony-10uk-net "View tony@10uk.net's Profile")**
- [![tony@10uk.net's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6276-tony-10uk-net "View tony@10uk.net's Profile") Topic Author
- [ Offline](/forum/user/6276-tony-10uk-net)

Less More

- Posts: 127
- Thank you received: 12
-
-

13 years 9 hours ago [\#134263](#134263) by [tony@10uk.net](/forum/user/6276-tony-10uk-net "View tony@10uk.net's Profile")  Replied by *[tony@10uk.net](/forum/user/6276-tony-10uk-net "View tony@10uk.net's Profile")* on topic *[SOLVED: Bulk Create Product Category Rows](/forum/32-content-creation/863903-solved-bulk-create-product-category-rows#134263 "-- url of the page with the problem -- : not required -- HikaShop version -- : 1.5.7 -- Joomla version -- : 1.7 -- PHP version -- : not required -- Browser(s) name and version -- : not required -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hello,  I wish to add many products (1000s) into a new category. That category will be applied to a discount code.  I have two options:  1) Spend a long time using the backend to update the relevant products with the new category.  2) Bulk change the database.  I wish to do the second of these.  Looking at the database, there are three tables: - Category - Product - Product Category  It seems to me that Product Category is an m:n resolver between the other two tables.  My plan is to simply insert rows into Product Category combining the relevant Category IDs and Product IDs and allowing the primary key to auto increment.  This seems quite straight forward.  My question is... Are there any other tables involved? Will this work? Do you envisage any problems by doing this?  Many thanks,  Tony")*

Thank you.

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

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