function hook_uc_order_product_alter in Ubercart 8.4
Same name and namespace in other branches
- 7.3 uc_order/uc_order.api.php \hook_uc_order_product_alter()
Allows modules to alter order products when they're loaded with an order.
Nothing should be returned. Hook implementations should receive the $product object by reference and alter it directly.
Parameters
\Drupal\uc_order\OrderProductInterface &$product: The product object as found in the $order object.
\Drupal\uc_order\OrderInterface $order: The order object to which the product belongs.
2 functions implement hook_uc_order_product_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- uc_attribute_uc_order_product_alter in uc_attribute/
uc_attribute.module - Implements hook_uc_order_product_alter().
- uc_product_kit_uc_order_product_alter in uc_product_kit/
uc_product_kit.module - Implements hook_uc_order_product_alter().
3 invocations of hook_uc_order_product_alter()
- Order::postSave in uc_order/
src/ Entity/ Order.php - Acts on a saved entity before the insert or update hook is invoked.
- Products::addProductSubmit in uc_order/
src/ Plugin/ Ubercart/ OrderPane/ Products.php - Form submit callback: add a product to an order.
- uc_product_kit_uc_order_product_alter in uc_product_kit/
uc_product_kit.module - Implements hook_uc_order_product_alter().
File
- uc_order/
uc_order.api.php, line 112 - Hooks provided by the Order module.
Code
function hook_uc_order_product_alter(OrderProductInterface &$product, OrderInterface $order) {
$product->model = 'SKU';
}