Jump to content

CSV Import Script


Recommended Posts

I'm making right now a CSV import script using the WHMCS API:

 

Currently is working ok for the addclient Function and i will continue with the addorder function for domains and hostings.

 

But 'm having a problem, the csv have the hosting plans with names not with product ids like the api function needs, it would not be a problem with a GetProducts function in the API but it doesnt exist.

 

Any way to get the product id by name something like:

 

getProductDetails($product_name);

 

Regards

Link to comment
Share on other sites

  • 2 weeks later...

wwwcad: you can get the product id of a product name w/ a quick SSL query:

 

ie:

<?php
include("configuration.php");
include("includes/functions.php");

$SQL = "SELECT `id`,`name` FROM `tblproducts` WHERE `name` like '%vps-1%'";
$res = mysql_query($SQL);
$row = mysql_fetch_assoc($res)

$productid = $row['id'];

 

Hope this helps you at all?

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...
  • 2 weeks later...
  • 5 weeks later...

Sorry about my late response. I didn't receive any notification of the post.

 

Here is a Link to the Blog Post where you can download the module for free: http://dev.imaginacolombia.com/home/item/csv-import-and-update-script-for-whmcs'>http://dev.imaginacolombia.com/home/item/csv-import-and-update-script-for-whmcs

 

More info and add-ons: http://dev.imaginacolombia.com

Link to comment
Share on other sites

  • 2 weeks later...

Hi, I'm having trouble getting this module to work, I've copied it into billing/modules/admin and I have also changed the API username and password in the importcsv.php file. When I go into Addon Modules and then importcsv it just gives me a blank screen with no settings to configure.

Maybe I'm doing something wrong, any help would be appreciated.

Thanks

Tinus

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 1 month later...
  • 5 months later...
  • 1 month later...
  • 3 months later...
  • 1 month later...

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