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
No related branches found
No related tags found
No related merge requests found
......@@ -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
* available in all rules.
* 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
* prices of the order.
* will contain all products in 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(...).
* 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.
* 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) {
// Called for the whole cart...
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment