SOLVED: Bulk Create Product Category Rows

  • Posts: 127
  • Thank you received: 12
10 years 11 months ago #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_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: 10 years 11 months ago by tony@10uk.net.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
10 years 11 months ago #134123

Hi Tony,

Note that another solution can be to :
- Create some products manually
- Export them through the EXPORT button of the page "Hikashop->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 or Create an account to join the conversation.

  • Posts: 127
  • Thank you received: 12
10 years 11 months ago #134137

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 or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 11 months ago #134198

Yes, just this one.

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 127
  • Thank you received: 12
10 years 11 months ago #134263

Thank you.

Please Log in or Create an account to join the conversation.

Time to create page: 0.068 seconds
Powered by Kunena Forum