Magento exchange with 1C


I am sharing my updated one-sided solution for a bundle of 1c and Magento 1.9.* In Automatic mode.
1C UT 10.3 upload mechanism --->.csv file ---> magmi ---> Magento

Processing can allow you to unload different warehouses, different groups, different prices. A kind of "multi-warehouse".
To implement, read my instructions and the Magmi instructions and think a little.

The 1C code acts as the SKU. For each product in 1C, it is unique and the most convenient option for synchronization.
P.S.:
In my case, the "1c product characteristics" are not used, because this function is not declared in processing. Consider this point.
PS:
The characteristics of the product and the properties of the product in 1C are different things. Product properties processing supports.

Processing does not require integration into the 1c configuration!

Spoiler: Description
Processing is created for automatic exchange between 1c UT 10.3 and Magento 1.9 via Magmi.
It polls commodity items and creates a file .csv ready to upload to Magmi.
Main functions and parameters:
The "Upload to disk" tab.
This tab contains the main elements of unloading the price list in .csv format. The extension itself and the encoding of the file are already registered in the processing, these parameters are changeable only in the configurator.
Available tab fields:
1). Upload settings directory.
This function saves the upload settings you specified for further automatic processing and quick access. (Attention! If you make changes to the processing in the configurator, and then upload the old settings file, your changes!executed now! processing will reset and may "fail")
2). Group - which groups of the item you want to upload to the file.
3). Warehouse - which warehouses of the nomenclature you want to upload to the file.
4). Date - on what date you want to upload. By default, it is the current one.
5). Price type - the prices you want to upload. For more details, see the description of the "Uploaded information" tab.
6). The exchange directory on the disk is the directory where the .csv file will be uploaded and from where the processing will send it to FTP.
7). File name - the name of the file in the directory on the disk. Expansion.csv is substituted automatically, you do not need to specify it in the file name. At the same time, if a file with this name already exists in the upload directory, processing will overwrite it!
8). Image catalog is a tested functionality for uploading images from 1c to FTP. It will be available in future versions.

The "Upload to FTP" tab
Basic parameters of the FTP connection. Attention! Processing does not work with SFTP and FTPs. Main port = 21. (Can be changed in the configurator.)
1). FTP host: - your FTP server IP address in the form - 192.168.1.1
2). FTP login: - FTP username
3). FTP password: - FTP user password
4). FTP directory: - directory where it is necessary to upload the file. End the catalog with /
In my case, I created an FTP user with access only to the directory /magento/var/import/ which reads Magmi.
5). File name on FTP: - file name.csv uploaded to your FTP server.
The extension is inserted automatically, it is not required to specify.
If a file with this name exists, processing will overwrite it.
!Don't forget to give out permissions for the FTP user to write!

The "Uploaded Information" tab
1). "Category" - unloads product categories in a format readable by Magmi - "categories". I.e. if your categories in the database and on the site are the same, you do not need to put the product in folders.
2). "Product code" - unloads the "code" of the product in the "sku" column.
3). "Article" - unloads the "article" of the product in the "art" column. (Non-standard Magento attribute)
4). "Name" - unloads the "name" of the product in the "name" column
5). "Barcode" - unloads the "barcode" of the product in the "barcode" column
6). "Remainder" - unloads the "remnants of the goods in warehouses (all or one) in the qty column
7). "Prices" = unloads the prices of the goods.
For this function, you need to assign the following parameters:
In the "Item Price types" directory in your database, fill in the comment field for each desired price. For example:
Retail price = comment = price
Discounted price = comment = special_price
The name of the prices in your database does not have to be like this. Processing will poll only the "comment" field.
8). "Description" - processing will poll the "Additional description of the nomenclature" field of the product and fill in the "description" column
9). "Comment" - will poll the "comment" field of the product! and fill in the "comment" column (I don't use it myself)
10). "All goods" - this function will poll all goods at the warehouse you specified, even if they are actually out of stock and they do not have the prices you specified. At the same time, the goods missing from the warehouses of the enterprise will receive the number "2" in the "status" column - Magento will set the status "disabled" for them during import and the product page will be unavailable in "fronted", i.e. 404.

The "Auto-exchange" tab
Processing can perform upload and exchange with FTP in automatic mode. To do this, the following conditions must be met:
1). Create a new user in the 1c database with the name Auto and password 159159
2). Start processing under a regular user.
3). Fill in the FTP settings, unloaded groups and warehouses, price type.
4). Fill in the catalog of unloading settings. For example D:\Obmen-s-site\Settings
5). Check the box "Close processing after unloading".
This function will automatically close 1C with the Auto user after uploading to disk and to FTP in 15 minutes. This time is specified for unambiguous file transfer to FTP with all timeouts.
6). !!! Save the upload settings on the "Save settings" button.
This will save your FTP settings, warehouses, prices, etc. to a separate file on disk.
7). !!! Save form values. (Next to the action button at the top)
This will save your upload settings directory. If it is not there, the processing will not find the necessary settings when automatically starting.
8). Configure the attached file.bat
"Path to 1C" enterprise /F"Path to database" /NAuto /P159159 /Execute"The path to processing" /A saved adjustment to the booting process
Sample file:
"C:\Program Files (x86)\1cv8\common\1cestart.exe" enterprise /F"D:\UT" /NAuto /P159159 /Execute"D:\Obmen-s-site\exporttocsv.epf" /C1

For a full automatic exchange, configure the task scheduler in Windows where you have a database with 1c,
And cron on the site for automatic Magmi operation on a schedule.
Code for Cron Magmi:
! php /Path to the root folder сайта/magmi/cli/magmi.cli.php -mode=create -profile=default
Decoding:
-mode=create - will update the current positions and create new ones.
-profile=default - execution profile. You can create multiple upload profiles with different uploaded files. See the Magmi documentation.
Attached to the file .bat - for the task scheduler and scheduled upload settings.
It is planned to add the function of uploading photos from 1C to the site. The mechanism is already there, but not debugged. Unloading properties from 1C works, but it is not included in the description, so test it.


Go back
12-11-2022, 10:01