Magento Product Management Plugin

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.

SelerCloud supports Magento versions 1 and 2. Different plugins with different installations instructions are required for each version.

Magento Version 1+
Obtain Magento Plug-In from SellerCloud Support and install on FTP.

HOW TO INSTALL:
  1. Upload _import folder off plugin to http://yoursite.com/ so that http://www.yoursite.com/_import is accessible
  2. Upload _export folder off plugin to http://yoursite.com/ so that http://www.yoursite.com/_export is accessible
  3. Please make sure "files" under _import and _export folders have execution rights. 0445 is preferred, otherwise 0777.
  4. Please make sure _import and _export folders have execution rights set to 0775 or 0777.
  5. 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:
  1. Upload extension: upload to remote server so that Sellercloud folder (in plugin zip) is placed under /app/code
  2. 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.
  3. 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".
  4. 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.
  5. Clean Cache: Either from Admin > System > Cache Management OR through command "php bin/magento:cache:clean"
  6. SSH Access is needed if we need to run command from console. Example: 
    1. After logging into SSH console - 
    2. command: cd public_html
    3. command: bin/magento setup:upgrade
    4. 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.php?id=<JOBID>
Please replace <JOBID> 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.

4. Setup SellerCloud to port the product XML to the Magento site:
Note: There is no need to map SellerCloud fields to magento fields.
a. Navigate to Home > Companies > YourCompany > Magento General Settings
b. Magento Enabled []checkbox should be ON
c. Switch on the checkbox[] “Enable Custom Plug-in for Communication”
d. Enabling “Enable Custom Plug-in for Communication” above will allow the user to
enter magento plug-in URL.
            i) Enter your magento URL in the textbox, captioned as “Custom Plug-in Base URL”. The plug-in base URL should look like “http://yoursite.com/"
            ii) Most likely, you will also want to check the following options: 'Enable New Products upload' and 'Enable Update existing Products'

5. Filter products in SellerCloud and export them to Magento
a. Go to Manage Inventory->Search
b. 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.
c. 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.
d. 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.
        i) You will be taken to another page displaying your product selection. Click the button “Launch on Magento”.
        ii) If number of items is small, (<=5), plug-in will process the products immediately, otherwise a job will be scheduled in order of execution.

6. 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.php?id=ABC
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>



Comments