Overview
This article will explain the process for the Magento product management plugin. This plugin lets you import selected products into Magento from Sellercloud.
Install the Plugins
Sellercloud creates XML based on selected products and calls the plug-in in this context located in your Magento site and updates those products directly without using the native Magento API. This facilitates smooth and performing product/inventory updates to your Magento website.
Sellercloud supports multiple versions of Magento and integrates with V2.5.5.1 (current) back to V1.8.6. Different plugins with different installation instructions are required for each version.
Magento Version 1+
To install the plugin:
- Obtain the Magento Plug-In from Sellercloud Support and install it on the FTP.
- Upload the import folder of the plugin to http://yoursite.com/.
- Upload the export folder of the plugin to http://yoursite.com/
Magento Version 2+
To install the plugin:
- Go to Admin > Store > Configuration > Advanced > Enable Sellercloud_Scm2.
- Upload to remote server so that Sellercloud folder – in plugin zip is placed under /app/code
- Run setup upgrade:
- Log into your terminal via ssh access > Go to your Magento root directory > Run the command php bin/magento setup:upgrade.
- Compile:
- Run the command sudo ./magento setup:di:compile. The compilation is needed when any modified code in the extension is uploaded. This can take more than 10 minutes.
- Clean cache:
- Either go to from Admin > System > Cache Management OR
- Through command php bin/magento:cache:clean
- SSH Access: Needed if we need to run command from console. Example:
- After logging into SSH console:
- command: cd public_html
- command: bin/magento setup:upgrade
- command: bin/magento setup:di:compile
- After logging into SSH console:
Setup the CRON
CRON is usually set up within the control panel of your site. Create a CRON entry at an interval of your choice, set /www/…/cron.php as the endpoint. Normally, CRON path is a physical path to the cron file i.e. /public_html/_import/cron.php. CRON service will fire at a predetermined interval and will execute one job at a time based on the job’s creation date.
Export products to Magento:
- Go to Settings > Companies > Manage Companies > Open a company.
- Go to Toolbox > Magento General Settings > Check the Magento Enabled and Enable Custom Plug-in for Communication boxes. Note: Enabling Enable Custom Plug-in for Communication will allow the user to enter magento plug-in URL.
- Filter products in Sellercloud and export them to Magento:
View the status of a job
Check the status of a submitted request by viewing the job status. Sellercloud has an uploaded file log, that will show you the Job# and you can use that to look up the log.
To check the status:
- Go to Settings > Companies > Manage Companies > Open a company.
- Go to Toolbox > Magento General Settings > Documents. You will find a list of jobs executed or queued to be executed.
This plug-in lets you import selected products into Magento from SellerCloud. Sellercloud creates XML based on selected products and calls the plug-in in this context located in your Magento site and update those products directly without using the native Magento API. This facilitates smooth and performing product/inventory updates to your Magento website. We do have the option to import products into Magento without a plugin but it is limited in many ways. For example, the Magento API doesn’t support configurable products, such as products with various sizes and colors. Also, the Magento API can be very high on bandwidth and slow things down if you are managing many thousands of products. We developed this plugin to avoid the limitations of the native Magento API.
Magento Version 1+
HOW TO INSTALL:
- Obtain the Magento Plug-In from Sellercloud Support and install it on the FTP.
- Upload the import folder of the plugin to http://yoursite.com/.
- Upload the export folder of the plugin to http://yoursite.com/
Make sure the files under _import and _export folders have execution rights set to 0775 or 0777.
- The first time, the import.php is called; a MySQL table will automatically be created in the same database your Magento instance is using.
Structure of the table: job id BIGINT NOT NULL AUTO_INCREMENT, submittedon DATETIME NOT NULL , processedon DATETIME NULL , localfilename VARCHAR( 100 ) NOT NULL , status TINYINT NOT NULL , logfilename VARCHAR( 100 ) NOT NULL Note: “id” is the primary key.
Magento Version 2+
HOW TO INSTALL:
- Upload extension: upload to remote server so that Sellercloud folder (in plugin zip) is placed under /app/code
- Enable module: a) Go to Admin > Store > Configuration > Advanced > Advanced. Enable “Sellercloud_Scm2” OR b) from FTP, edit /app/etc/config.php, add an entry ‘Sellercloud_Scm2’ => 1.
- Run setup upgrade: Log into your terminal via ssh access and go to your magento root directory. Then run this command “php bin/magento setup:upgrade”.
- Compile: Run this command “sudo ./magento setup:di:compile”. Compilation is needed when any modified code in extension is uploaded. This can take more than 10 minutes.
- Clean Cache: Either from Admin > System > Cache Management OR through command “php bin/magento:cache:clean”
- SSH Access is needed if we need to run command from console. Example:
- After logging into SSH console –
- command: cd public_html
- command: bin/magento setup:upgrade
- command: bin/magento setup:di:compile
Setup the CRON: (Use the following steps if you want to automate the scheduled import)
Why set up CRON? Say you selected some products in Sellercloud console for the purpose of exporting into Magento site (refer to 5. FILTER PRODUCTS IN SELLERCLOUD… ). When you do Launch on Magento Sellercloud will create a job in Magento site database, because product import in Magento can take considerable amount of time. If CRON is set up in your Magento site control panel, it is your Magento site’s responsibility to execute “import process” internally. You don’t need to wait for the “import process” to be complete in Sellercloud console. So, based on the number of products, you can set the CRON interval. If you think that the “import process” is a one time thing, you can disable CRON after process is over.
CRON is usually set up within the control panel of your site. Create a CRON entry at an interval of your choice, point /www/…/cron.php as end point. Normally, CRON path is a physical path to the cron file i.e. /public_html/_import/cron.php. CRON service will fire at a predetermined interval; will execute one job at a time based on job’s creation date. Note that interval for the CRON depends on how long each import job takes. All the jobs with the status of “submitted” or “processing” are eligible for execution.
Manual execution of Job: If somehow, you want to run or re-run a job, open http://yoursite/_import/cron.p…
Please replace with the actual Magento Job#. Where to find job# ? Open Sellercloud console, navigate to Home->Companies->YourCompany->Magento General Settings->Uploaded Documents. You will find a list of jobs executed or queued to be executed.
- Setup Sellercloud to port the product XML to the Magento site:
Note: There is no need to map Sellercloud fields to magento fields.
- Navigate to Home > Companies > YourCompany > Magento General Settings
- Magento Enabled []checkbox should be ON
- Switch on the checkbox[] “Enable Custom Plug-in for Communication”
- Enabling “Enable Custom Plug-in for Communication” above will allow the user to enter magento plug-in URL.
- Filter products in Sellercloud and export them to Magento
- Go to Manage Inventory->Search
- Search the products to get a filtered list of products or allow search to display all the products. You should be able to see which rows are enabled for Magento by checking the Magento icon.
- To export a single product from SellerCloud, click on Magento icon. On the Magento Properties page, select the action “Post product on Magento” and click go button.
- To export multiple products from SellerCloud, select products that you want to export from Manage Inventory and then the action “Launch on Channel” press GO. Then select Magento and click Continue.
- Check the status of a submitted request by viewing the job status. Sellercloud has an uploaded file log, that will show you the Job# and you can use that to lookup the log. If your job ID# is 123, then use the url http://yoursite/_import/getjob… The XML for that job which should look like this:
<jobresult> <id>123</id> <status>completed</status> <submittedon>2012-11-30 04:01:42</submittedon> <processedon>2012-11-29 23:01:42</processedon> <localfilename>import-xml-121130040142.xml</localfilename> <logfilename>import-log-121130040142.xml</logfilename> <products/> </jobresult>
After you get this response, use the logfilename to get additional detail about what happened with this job. Here is an example of what import-log-121130040142.xml would look like:<jobresult> <id>123</id> <status>completed</status> <submittedon>2012-11-30 04:16:08</submittedon> <processedon>2012-11-29 23:16:13</processedon> <localfilename>import-xml-121130041608.xml</localfilename> <logfilename>import-log-121130041608.xml</logfilename> <products> <product> <sku>SKU001</sku> <status>success</status> <errors/> </product> </products> </jobresult>