Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Shipping by Rules for VirtueMart
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VirtueMart
Shipping by Rules for VirtueMart
Commits
32bcdc11
Commit
32bcdc11
authored
8 years ago
by
Reinhold Kainhofer
Browse files
Options
Downloads
Patches
Plain Diff
Plugin template: fix callback function signature
parent
3b936e74
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/template/YOUR_PLUGIN_NAME.php
+4
-5
4 additions, 5 deletions
plugins/template/YOUR_PLUGIN_NAME.php
with
4 additions
and
5 deletions
plugins/template/YOUR_PLUGIN_NAME.php
+
4
−
5
View file @
32bcdc11
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment