commerce_pvt
Synopsis
This module aims to expose all the product variation in a VIEW table and adding them to cart.
This tool is usefull for a wholesaling way of acquiring the stock of items, where a person who's buying, has to add many variations with different quantities at once.
Features
- This module can operate as a simple quantity fields with a big submit button below,
- or with Enhanced version of the quantity widget, with Plus / Minus buttons around that operates in ajax mode, and can be delayed via debounce (with configuration). So basically you can click many times to increase the quantity before the update event is fired
Known problems
This module depends on this patch for Drupal commerce: #3017662: Order Item Type Resolving Mechanism! But, if you don't have any custom logics or custom/different order types / users roles to manage - fear not installing this patch anyway - it won't change any commerce logic for you. The Chain Resolving process of the Order Item Type is transparent without any custom resolvers installed. Yet, you still need the patch for this module to work.
Requirements
Drupal commerce compatibility
- ≥ 2.15 < 2.28 (drupal core ^8.9) -> commerce_pvt 2.x branch
- ≥ 2.28 < 3.0 (drupal 9, 10, 11) -> commerce_pvt 2.x branch
- ≥ 3.0 (drupal ^10.3, 11) -> commerce_pvt 3.x branch
PAY ATTENTION:
if you want your Drupal project to accept the patches from dependencies (like in this module: we need to patch commerce module to work properly) we need the cweagans/composer-patches and specify an extra option too:
{
...
"require": {
"cweagans/composer-patches": "^1.5.0"
},
"extra": {
"enable-patching": true
}
}
Roadmap
0. Manage the above mentioned PATCH to be pulled into Commerce Core project (i'm affraid this will never happen)
1. Finish developing the code and polish the rails
- Make the view as Pseudo field instead of preprocessing it as simple array to render.
- Create a configuration for enhanced widget with +/- wrapper elements
- Make the Enhanced widget delay-able via debounce
2. Write a documentation (any)
- User guide
3. Write some Tests to look cool and approved
- Drupal commerce patch tests that confirm the idea behind
- Any possible tests (the Commerce core patch from above, contains new tests for commerce_order sub-module within it)