shahin Posted August 18, 2005 Share Posted August 18, 2005 Hi, I have almost completed adding products to my online shop. But I am worried about the stocklist. I am trying to explain my problem below, #Customer shop in my website >> the order come to me as an email >> I just forward the same email to our supplier >> the supplier will deliver the product to our customer on my behalf. We just have one supplier. The supplier has about 2000 products . In my shop I will sell all of the products. They are a very big supplier. Their stock changes very quickly. #I need to find a way to connect to their database and import the stocklist automatically. #I have already contacted with my supplier. Their IT Specialist suggest me that they will output to me a file which will have two columns, ProductCode and Quantity. I will have a number of components. 1. php script that retrieves the file and imports it into a temporary table 2. php script that updates quntities in product table with values in temporary table based on ProductCode 3. a simple batch file that will ftp to smiffys and get the output file and then call each of the above two scripts. I have to schedule the batch file to run every 15 minutes or more and I have to able to specify how often I want the product file output by the supplier. I don't know how to implement these techniques with oscommerce. I will be very grateful if anybody can assist me to solve this problem. Thanks in advance. Kind Regards, Shahin Link to comment Share on other sites More sharing options...
shahin Posted August 18, 2005 Author Share Posted August 18, 2005 I want to update my stocklist automatically. I will be very grateful if anybody can help me to solve my problem. Kind Regards, Shahin Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted August 18, 2005 Share Posted August 18, 2005 I want to update my stocklist automatically. I will be very grateful if anybody can help me to solve my problem. Kind Regards, Shahin <{POST_SNAPBACK}> if the supplyer is able to access your ftp files and dump a text file there with these two columns, there is no reason why you should not be able to have a cron job scheduled to truncate a table you create for this reason, fill it with the new data and runan update from statement for the quantity. :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
shahin Posted August 18, 2005 Author Share Posted August 18, 2005 if the supplyer is able to access your ftp files and dump a text file there with these two columns, there is no reason why you should not be able to have a cron job scheduled to truncate a table you create for this reason, fill it with the new data and runan update from statement for the quantity. <{POST_SNAPBACK}> Dear Monika, The supplyer will not access to my ftp. I have to access to their ftp and get the the file. When I contact with my supplyer regarding this matter, their IT specialist suggest me that I will have a number of components. 1. php script that retrieves the file and imports it into a temporary table 2. php script that updates quntities in product table with values in temporary table based on ProductCode 3. a simple batch file that will ftp to the supplyer and get the output file and then call each of the above two scripts. I am new at php and mysql. The whole proces seems very complex to me. I will be grateful if you could suggest me the procedures of solving the problem in details. Regards, Shahin Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted August 18, 2005 Share Posted August 18, 2005 Dear Monika, The supplyer will not access to my ftp. I have to access to their ftp and get the the file. When I contact with my supplyer regarding this matter, their IT specialist suggest me that I will have a number of components. 1. php script that retrieves the file and imports it into a temporary table 2. php script that updates quntities in product table with values in temporary table based on ProductCode 3. a simple batch file that will ftp to the supplyer and get the output file and then call each of the above two scripts. I am new at php and mysql. The whole proces seems very complex to me. I will be grateful if you could suggest me the procedures of solving the problem in details. Regards, Shahin <{POST_SNAPBACK}> Hi sorry, I do not know about batchjobs and ftp. If you can find out how to get the file over to you, I can tell you what to do with it then. :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
shahin Posted August 18, 2005 Author Share Posted August 18, 2005 Hi sorry, I do not know about batchjobs and ftp. If you can find out how to get the file over to you, I can tell you what to do with it then. <{POST_SNAPBACK}> Hi Monika, Thank you very much for your on-going support. My supplyer keep a file on their server. The file contains two columns -product code and quantity. They provide me a user name and password to access to their server. Now , I need php script that retrieves the file and imports it into a temporary table and another php script that updates quntities in product table with values in temporary table based on ProductCode. As I am new at php and MySQL . I don't know how to implement this. I am in need of your help to solve this problem. Kind Regards, Shahin Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted August 18, 2005 Share Posted August 18, 2005 Hi Monika, Thank you very much for your on-going support. My supplyer keep a file on their server. The file contains two columns -product code and quantity. They provide me a user name and password to access to their server. Now , I need php script that retrieves the file and imports it into a temporary table and another php script that updates quntities in product table with values in temporary table based on ProductCode. As I am new at php and MySQL . I don't know how to implement this. I am in need of your help to solve this problem. Kind Regards, Shahin <{POST_SNAPBACK}> hi, like I said I have no experience with the first part. Maybe someone here who does more admin jobs can help you. For the second part, take the file checkout_process.php for learning. It is a file that just DOES stuff, and doesn't display anything. There you will fing examples for insert. For delete, check admin/categories.php, plenty of examples there. To update values form one table to another, you will need to use a special syntax called "update from". You can find that if you google for it, adding the word mysql to the search. :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.