Over 200 add-ons available under a single subscription for $40 per month!

Zeros for the quantity of goods when exchanging with Commerceml

The module puts zeros for the quantity of goods in warehouses, which are absent when transferring data from 1C.
Please enter a valid addres(es) of the shop where you are going to use the add-on.
By subscription 6 000 ₽
Latest module version Updated:
Have questions about the module? Write to us: HelpDesk

Zero product quantities during CommerceML exchange

This add-on is part of our Subscription plan.

Subscribe once and use all add-ons without limits.

The add-on extends the 1C CommerceML exchange and prevents outdated stock from remaining in warehouses omitted from the current upload. If a warehouse exists in the store but no quantity is provided for a product, the add-on supplies a value of 0 for processing.

What it is for

A 1C upload may contain only some warehouses. Without additional processing, the quantity in an omitted warehouse remains from the previous exchange. The add-on removes this discrepancy and helps keep warehouse stock aligned with the current exchange data.

Key features

  • Zeroes product quantities in store warehouses with no data in the current exchange.
  • Processes the warehouse list received during CommerceML catalog import.
  • Excludes exchange warehouses that do not exist in the store.
  • Builds a cron command for a one-time full stock reset.
  • Works with the CommerceML and Warehouses add-ons.

How it works

During catalog import, the add-on stores the mapping between external warehouse identifiers and store warehouses. For each product, it compares this list with the quantities in the current upload. If a warehouse exists in the store but has no submitted quantity, the add-on adds a value of 0 to the product data.

The settings also provide a cron command protected by a secret-key hash. It is intended for a one-time full reset of warehouse and overall stock before current values are restored by a subsequent exchange.

Have questions about the add-on?

Write to us.


Localization:
  • English
  • Русский
Compatible versions:
  • 4.18.X

Instructions for “Zero product quantities during CommerceML exchange”

What the add-on does

The add-on extends product quantity data during a CommerceML exchange. If a warehouse exists in the store but the current upload provides no quantity for that warehouse, the add-on supplies a value of 0. Warehouses that do not exist in the store are excluded from processing.

The add-on can also reset all warehouse and overall stock once through a cron command.

Where to find the add-on

Go to Add-ons → Manage add-ons → Zero product quantities during CommerceML exchange.

The CommerceML and Warehouses add-ons must be installed and enabled for automatic processing. The exchange must use valid HTTP Basic authentication.

Add-on settings

Secret key (secret_key) protects the full-reset action. The command URL contains the MD5 hash of the current key. The default value is ms_cml_fill_empty_amount; replace it with a unique value before enabling the cron job.

Cron link displays a ready-to-use command after the secret key is filled in. Copy the command from the add-on settings.

Automatic zeroing during exchange

  1. Start an authenticated CommerceML catalog import.
  2. The add-on obtains the mapping between external warehouse identifiers and store warehouses.
  3. When a product is processed, the add-on adds a quantity of 0 for each existing warehouse that has no data in the current upload.

Full reset through cron

The add-on generates a command in the following form:

0 4 * * * php<version> <store root>/<storefront script> --dispatch=ms_cml_fill_empty_amount.reset --hash=<MD5 of the secret key>

Copy the command from the settings and add it to the cron scheduler. The operation runs only if the supplied hash matches the MD5 hash of the current secret key.

Important: the command zeroes every value in the warehouse stock tables and the overall product quantity. The operation has no built-in rollback. Back up the database first and make sure a full exchange can run immediately afterward to restore current stock.

How to check the result

Automatic mode: run a test exchange where one existing warehouse is omitted for a selected product. After import, check the product quantities by warehouse: the omitted warehouse must contain 0, while submitted warehouse values must match the upload.

Full reset: test only on a staging copy or after creating a backup. Run the command from the settings and confirm that warehouse and overall quantities are 0. A command with a modified hash must not perform the reset.

Changelog

v1.0.2 from 30.09.2026

[*] Updated the add-on code, templates, and integration files.

[*] Updated the add-on description, instructions, changelog, and logo.

v1.0.1 from 2024-09-18

[*] Add-on standardisation.

[+] Zeroing of product stock in the database through cron.

v1.0.0 from 2022-04-06

[+] Initial release.

Legend:

[+] Added

[-] Removed

[*] Changed

[!] Bug fixed

Reviews

Here you can share your opinion and evaluate our work.

Your feedback helps us become better and offer you even better service.

Similar add-ons