Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Importing Products Automatically
 
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 07-24-2016, 04:36 PM
 
garys garys is offline
 

Newbie
  
Join Date: Jul 2016
Posts: 5
 

Default Importing Products Automatically

I would like to import product information automatically (v5.2.15) but I must be missing a step here.

Creating the correct .csv file is no problem. I uploaded that file using FTP to the /var/import folder. When I run the Import function from within the administration section after uploading, it doesn't even prompt me to browse for a file name, presumably because a valid file is already sitting there waiting to be processed. It just goes ahead and processes the uploaded file. This tells me that the file is in the correct location and the format is also correct.

I have read the "Configuring your server to run scheduled X-Cart tasks" page (http://kb.x-cart.com/pages/viewpage.action?pageId=7504112) and this seems to be what I want to do.

When I ran the "php console.php --target=cron" command in my SSH console, it looked like it successfully processed 2 steps. One of them was "Event listener (DB)" and the other one had to do with creating the XML sitemap.

When I looked at my catalog, the product that I was trying to import was not there.

I then tried the Import function again and it processed the file successfully.

Now, I also ran across some information about the TASKS table in the database. Do I have to add a record to that table to tell it that I want to import the data automatically? If not, what could I be doing wrong here?

Any help would be appreciated.

Thank you.
__________________
5.2.15
Reply With Quote
  #2  
Old 07-25-2016, 08:43 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,825
 

Default Re: Importing Products Automatically

Gary,
You are not doing anything wrong. X-Cart just doesn't automatically import products when cron is run. So to do this you need to write a custom module that registers the task and triggers the import.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 07-25-2016, 06:19 PM
 
garys garys is offline
 

Newbie
  
Join Date: Jul 2016
Posts: 5
 

Default Re: Importing Products Automatically

Thanks, Mike.

The documentation on the cron page led me to believe that importing products was part of the tasks to be run.

I will look into creating a custom module. If I run into any difficulty, I know where to find you.
__________________
5.2.15
Reply With Quote

The following user thanks garys for this useful post:
totaltec (07-27-2016)
  #4  
Old 07-27-2016, 04:45 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Importing Products Automatically

What documentation article do you refer to? I believe the import/export function uses the cron task, but it is for splitting the process into multiple steps (in order to avoid the memory limit or the PHP time limit issues), not for starting the process automatically.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #5  
Old 07-27-2016, 08:15 AM
 
garys garys is offline
 

Newbie
  
Join Date: Jul 2016
Posts: 5
 

Default Re: Importing Products Automatically

In the "Configuring your server to run scheduled X-Cart tasks" page (http://kb.x-cart.com/pages/viewpage....pageId=7504112), it says:

Some X-Cart's features require periodic execution of the script console.php located in the X-Cart root. Running this script is used to trigger the execution of miscellaneous service and maintenance tasks, including, but not limited to:
  • the periodic execution of event tasks (i.e. tasks that are launched on event; examples of such tasks are exporting and importing of data from/into X-Cart);
This led me to believe that importing data was already part of the cron task. When I ran php console.php --target=cron, it did not automatically import my products.csv file. When I did the import function manually, it processed the file. I did not have to upload the file using the Browse button.

According to Mike, importing products is not done automatically as part of the cron task.

I believe that I have solved my problem by writing a script that imports the products. Everything seems correct.
__________________
5.2.15
Reply With Quote
  #6  
Old 07-27-2016, 08:45 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Importing Products Automatically

Thanks. I see where the confusion comes from.
But, yes, importing is not done automatically. The cron task is only used to trigger the steps that the whole import/export process is split into.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #7  
Old 01-22-2019, 12:05 AM
 
gior_08 gior_08 is offline
 

Member
  
Join Date: Sep 2008
Posts: 20
 

Default Re: Importing Products Automatically

Hello,

May I ask you a question I have about execute a scheduled task.

Lets say I want to execute an automatically renewal of the Facebook Ads and Instagram Ads addon Product Feed or an automatically re-generation of the XML sitemap.

The scripts that I am going to call are these:

https://www.MY_DOMAIN.com/admin.php?target=sitemap&action=Generate&xcart_for m_id=<MY_ID>

https://www.MY_DOMAIN.com/admin.php?target=facebook_marketing&action=Generat e&xcart_form_id=<MY_ID>

Am I correct?

Another question the xcart_form_id value is it fix or is it changing at each scripts call?
__________________
Xcart 4.x.x
Xcart 5.x.x
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:07 AM.

   

 
X-Cart forums © 2001-2018