- Issue created by @datawench
Is there a way to use different "out of stock" enforcement messages for different stock types? For example, I might want a book's out-of-stock message to be something like "No longer on our shelves", or a carburetor's be "Not available to install." You get the idea.
I can use a form_alter hook to add a field to the form at admin/commerce/config/stock/enforcement/settings
, adding message options for one specific type to the commerce_stock_enforcement.settings
configuration.
But in the actual commerce_stock_enforcement.module, the function commerce_stock_enforcement_is_order_in_stock()
is hardwired to retrieve only the original setting:
$message_text = Drupal::config('commerce_stock_enforcement.settings')
->get('insufficient_stock_cart');
As far as I can tell, I'd actually have to patch the module, to make alternate message settings available.
Is there perhaps a better way?
Active
1.3
Code