Jump to content

Importing Products


Recommended Posts

Thanks String,

I did see the API and can add a single product using the sample code however I am not a developer so taking it further so that I can bulk import is beyond me, I'm not too bad at hacking and adapting working scripts though

I am a little baffled why this is still not a capability of WHMCS itself as there seem to have been many requests over the years and would obviously help anyone who wanted to migrate to WHMCS although the trend does seem to be to move away ...

Link to comment
Share on other sites

That is incredibly kind string, I am most grateful for your offer

An example with header row and text below - the header rows correspond to the WHMCS tblproducts and the last two columns to tblpricing database (MFG & MPN are two columns that I have added to the WHMCS database)

type,gid,name,description,MFG,MPN,welcomeemail,paytype,allowqty,servertype,tax,currency,monthy

other,21,Test Product,This is a test product,Test,ABC-01234,21,onetime,2,,1,1,99.99

Regards
Rob

Link to comment
Share on other sites

1 hour ago, MrGettingRatherFrustrated said:

Thank you so much, you really are very kind 🙂
I will test 

It works great, thank you very much indeed.

I had to change the allowqty to use the post add logic you had as thats not available on the API

The only thing I'm still trying to work out is how (if) I can add multiple currencies to the price table in one go - I will carry on fiddling 🙂

Link to comment
Share on other sites

9 hours ago, MrGettingRatherFrustrated said:

The only thing I'm still trying to work out is how (if) I can add multiple currencies to the price table in one go - I will carry on fiddling

Thats pretty easy, we have this line in the script:

$data['pricing'][$values['11']]['monthly'] = $values['12'];

$values['11'] is the currencyId from the CSV and $values['12'] the monthly pricing.

If you want to add a second currency, you would add:

$data['pricing'][$currencyId]['monthly'] = 'PRICE'; // $currencyId = e.g. "2"

 

Edited by string
Link to comment
Share on other sites

  • 1 year later...
On 9/11/2021 at 4:45 PM, string said:

The file must be uploaded into the root directory of your WHMCS installation. I suggest to test it first in a developer WHMCS installation 🙂

I am not sure if your custom columns MFG / MPN are in tblproducts, so you would have to adjust the script if it is in tblpricing.

importProducts.zipUnavailable

I was wondering if I could get the spreadsheet for this.

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