Provides a service for bulk creation of Drupal Commerce entities such as attribute values and variations. Also, products can be bulk generated if the Commerce Generate ↗ submodule is enabled.
Tip: you can see this file in your browser by clicking the admin/help# link at the right of the Admin toolbar and then the admin/help/commerce_bulk# link in the list.
- Commerce Bulk on drupal.org ↗
- Commerce Bulk on github.com ↗
- admin/help/commerce_bulk#anonymize-orders
- admin/help/commerce_bulk#info-for-developers
- admin/help/commerce_bulk#todo
- admin/help/commerce_bulk#module-author
After installing the module go to a product/1/variations# tab and manage your variations using configurable variation actions which are self-explanatory and easy to use. Other contrib modules can add their own actions.
To set up an auto SKU pattern used for **Duplicate variation**
action just
press the **Add variation**
button and then click on
the admin/commerce/config/product-variation-types/default/edit/form-display# link in the SKU field description.
The SKU widget settings' summary explained:
- size: The size of the SKU field on a variation add / edit form.
- placeholder: The text appearing inside the empty SKU field.
- maximum: The maximum of SKU values that might be generated in one go.
Use it to restrict the number of variations to create by pressing
the
Create N variations
button. So, to create the next portion of variations the button should be pressed once more and more, etc.. - custom_label: Set a custom label for the field as the default "SKU" text for the label might be seen as confusing by some people.
- hide: Whether to hide the SKU field on a variation add / edit form. Note that, despite the field is not visible, a valid SKU value will be generated on the backend for the field.
- prefix: The text automatically prepended to a SKU value.
- suffix: The text automatically appended to a SKU value.
- auto SKU sample: The sample of the unique SKU ↗ that will be generated for the given product variation type.
Press an attribute **Bulk**
operation button while on
the admin/commerce/product-attributes# page.
Press an attribute **Bulk**
operation button while on
the admin/structure/taxonomy# page.
Manage an attribute values using configurable actions which are self-explanatory and easy to use. Other contrib modules can add their own actions.
Select orders to anonymize on the admin/commerce/orders# page and then select desirable fields on the action config form.
See an example how orders or any other entity type can be anonymized on a cron job:
@PHPFILE: commerce_bulk.module LINE:182 PADD:22 :PHPFILE@
All the above functionality is based on the **BulkVariationsCreator**
service
which you can use in your custom module. For example, let's say you want to
automatically create products with all possible or just a subset of
variations. It's easy, just see how the Commerce Generate GenerateProducts
plugin make it.
@PHPFILE: modules/commerce_generate/src/Plugin/DevelGenerate/GenerateProducts.php LINE:576 PADD:18 :PHPFILE@
Also, see how the service is called in the commerce_bulk.module
file.
@PHPFILE: commerce_bulk.module LINE:92 PADD:5 :PHPFILE@
- Apply mechanism to automatically add variation images based on a certain criteria.
- Create variations in a batch process. Example ↗
Vlad Proshin (drugan)
[[email protected]]([email protected])
[https://drupal.org/u/drugan](https://drupal.org/u/drugan)