Skip to content
Snippets Groups Projects
Commit 32bcdc11 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Plugin template: fix callback function signature

parent 3b936e74
Branches
Tags
No related merge requests found
...@@ -33,15 +33,14 @@ class plgVmShipmentRulesYOUR_PLUGIN_NAME extends VmPlugin { ...@@ -33,15 +33,14 @@ class plgVmShipmentRulesYOUR_PLUGIN_NAME extends VmPlugin {
* You can add new variables to the $cartvals array or modify existing ones. They will be directly * You can add new variables to the $cartvals array or modify existing ones. They will be directly
* available in all rules. * available in all rules.
* This trigger will be first called right before any rule is evaluated. In that case, $products * This trigger will be first called right before any rule is evaluated. In that case, $products
* will contain all products in the cart and $cart_prices will be an arrow containing the calculated * will contain all products in the cart.
* prices of the order.
* Please notice that this function might also be called for only a subset of products of the cart * Please notice that this function might also be called for only a subset of products of the cart
* when the plugin evaluates a scoping function like evaluate_for_categories(...). * when the plugin evaluates a scoping function like evaluate_for_categories(...).
* In that case, $cart_prices will be NULL and the $products array will hold only those products that * In that case, the $products array will hold only those products that
* actually match the filter, and only those should be used to calculate your custom variables. * actually match the filter, and only those should be used to calculate your custom variables.
* So you can not in general rely on the cart_prices argument to hold the properly summed prices. * So you can not in general rely on the $cart->cart_prices argument to hold the properly summed prices.
*/ */
function onVmShippingRulesGetCartValues(&$cartvals, $cart, $products, $method, $cart_prices) { function onVmShippingRulesGetCartValues(&$cartvals, $cart, $products, $method) {
if ($cart_prices) { if ($cart_prices) {
// Called for the whole cart... // Called for the whole cart...
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment