Jump to content

Copying Products & Custom Fields


Harrison

Recommended Posts

Hello all,

As I run a Game Server Provider (GSP) I have set the product categories as each game, and the products as the number of slots.

Is there a quick way to copy the products, as I have custom fields for each product.

 

I.e. Every product under Half Life 2 requires the custom feilds Server Name & RCON Password.

 

This would take ages to do one at a time. Is there any way I can copy and paste, then just go back and edit the name & price?

 

Thanks a lot.

Link to comment
Share on other sites

  • WHMCS CEO

Yes, you could do it in this way. I'm not sure how experienced you are with phpMyAdmin but if you can follow this you could do it. Begin by logging in to phpMyAdmin and opening the database where WHMCS is installed, then:

 

1. Browse to the tblproducts table

2. Click Export and get an export of the data in the table

3. Find the row containing the product you want to duplicate

4. Copy this and remove the id field, it will look something like:

INSERT INTO tblproducts ('0000000001','Game Server',...........

change it to:

INSERT INTO tblproducts ('','Game Server',.............

This will cause it to insert each row as a new product

5. Once you've got this line of SQL, click SQL on the top navigation bar

6. Paste your INSERT code into the box and run the query as many times as you need to until you have all the products you want. You will then see them all in the products table under one product group. You can then edit them as required, moving them to the different product groups and changing the pricing.

7. Finally, you need to copy the custom fields options. To do this, you need to export the data from the tblcustomfields table. Once you've done this, you should find 5 lines with the product id field set to the same value as the product id of the product you copied above. For every new product id you have entered, you need to insert these five lines with the productid value set to their new product id.

 

Hope that makes sense! If you get any problems, let me know.

 

Regards,

 

Matt

Link to comment
Share on other sites

  • 10 months later...

Matt thanks a lot for pointing out how to manually copy a product with it's attributes...

 

When you're doing a large number of products re-typing everything might leave something critical out and doing it manually in the database is rather technical!

 

I'm going to request that you also build something like this into the UI because that way it will it easier for non-technical people to copy products. Perhaps a 'clone product' button next to the edit and delete icons.

 

kindest regards,

Eugene

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated