Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Projects
Groups
Snippets
Sign up now
Login
Sign in
Toggle navigation
Menu
Open sidebar
VirtueMart
Shipping by Rules for VirtueMart
Commits
e200a1a3
Commit
e200a1a3
authored
Jul 14, 2015
by
Reinhold Kainhofer
Browse files
V5.5: Fix evaluate_for_skus function
parent
44a43124
Changes
6
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
e200a1a3
...
...
@@ -2,7 +2,7 @@ BASE=rules_shipping
BASE_ADV
=
rules_shipping_advanced
PLUGINTYPE
=
vmshipment
ZIPBASE
=
opentools_vm
VERSION
=
5.
4
VERSION
=
5.
5
PLUGINFILES
=
$(BASE)
.php
$(BASE)
_base.php
$(BASE)
.script.php
$(BASE)
.xml index.html
PLUGINFILES_ADV
=
$(BASE_ADV)
.php
$(BASE)
_base.php
$(BASE_ADV)
.script.php
$(BASE_ADV)
.xml index.html
...
...
releases/plg_opentools_vm_rules_shipping_advanced_v5.5.zip
0 → 100644
View file @
e200a1a3
File added
releases/plg_opentools_vm_rules_shipping_v5.5.zip
0 → 100644
View file @
e200a1a3
File added
rules_shipping.xml
View file @
e200a1a3
...
...
@@ -6,7 +6,7 @@
<authorUrl>
http://www.open-tools.net
</authorUrl>
<copyright>
Copyright (C) 2013-2014, Reinhold Kainhofer
</copyright>
<license>
GPL v3+
</license>
<version>
5.
4
</version>
<version>
5.
5
</version>
<description>
VMSHIPMENT_RULES_DESC
</description>
<files>
<filename
plugin=
"rules_shipping"
>
rules_shipping.php
</filename>
...
...
rules_shipping_advanced.xml
View file @
e200a1a3
...
...
@@ -6,7 +6,7 @@
<authorUrl>
http://www.open-tools.net
</authorUrl>
<copyright>
Copyright (C) 2013-2014, Reinhold Kainhofer
</copyright>
<license>
GPL v3+
</license>
<version>
5.
4
</version>
<version>
5.
5
</version>
<description>
VMSHIPMENT_RULES_ADV_DESC
</description>
<files>
<filename
plugin=
"rules_shipping_advanced"
>
rules_shipping_advanced.php
</filename>
...
...
rules_shipping_base.php
View file @
e200a1a3
...
...
@@ -469,7 +469,7 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
}
}
else
{
// BEGIN_RK_CHANGES: VM change in VM3!
if
(
is_array
(
$calculator
->
_cartData
))
{
// VM2:
if
(
isset
(
$calculator
->
_cartData
)
&&
is_array
(
$calculator
->
_cartData
))
{
// VM2:
$taxrules
=
array_merge
(
$calculator
->
_cartData
[
'VatTax'
],
$calculator
->
_cartData
[
'taxRulesBill'
]);
}
else
{
// VM3:
$taxrules
=
array_merge
(
$cart
->
cartData
[
'VatTax'
],
$cart
->
cartData
[
'taxRulesBill'
]);
...
...
@@ -1204,9 +1204,10 @@ class ShippingRule {
$filterkeys
=
array
(
"evaluate_for_categories"
=>
'categories'
,
"evaluate_for_products"
=>
'products'
,
"evaluate_for_products"
=>
'skus'
,
"evaluate_for_skus"
=>
'skus'
,
"evaluate_for_vendors"
=>
'vendors'
,
"evaluate_for_manufacturers"
=>
'manufacturers'
"evaluate_for_manufacturers"
=>
'manufacturers'
,
);
$conditions
=
array
();
...
...
@@ -1338,7 +1339,11 @@ class ShippingRule {
$op
=
array_shift
(
$expr
);
// ignore the "FUNCTION"
$func
=
array_shift
(
$expr
);
// The scoping function name
$expression
=
array_shift
(
$expr
);
// The expression to be evaluated
$conditions
=
$expr
;
// the remaining $expr list now contains the conditions
// the remaining $expr list now contains the conditions. Evaluate them one by one:
$conditions
=
array
();
foreach
(
$expr
as
$e
)
{
$conditions
[]
=
$this
->
evaluateTerm
(
$e
,
$vals
,
$products
,
$cartvals_callback
);
}
return
$this
->
evaluateScoping
(
$expression
,
$func
,
$conditions
,
$vals
,
$products
,
$cartvals_callback
);
}
elseif
(
is_array
(
$expr
))
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment