Commit 0a10823d authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Version 4.1: If a NoShipping rule has no Name, don't print any warnings...

parent d9abf4ca
......@@ -2,7 +2,7 @@ BASE=rules_shipping
BASE_ADV=rules_shipping_advanced
PLUGINTYPE=vmshipment
ZIPBASE=opentools_vm2
VERSION=4.0.1
VERSION=4.1
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
......
<?xml version="1.0" encoding="UTF-8" ?>
<install version="1.5" type="plugin" group="vmshipment" method="upgrade">
<name>VMSHIPMENT_RULES</name>
<creationDate>2014-01-14</creationDate>
<creationDate>2014-01-15</creationDate>
<author>Reinhold Kainhofer</author>
<authorUrl>http://www.open-tools.net</authorUrl>
<copyright>Copyright (C) 2013, Reinhold Kainhofer</copyright>
<copyright>Copyright (C) 2013-2014, Reinhold Kainhofer</copyright>
<license>GPL v3+</license>
<version>4.0.1</version>
<version>4.1</version>
<description>VMSHIPMENT_RULES_DESC</description>
<files>
<filename plugin="rules_shipping">rules_shipping.php</filename>
......
<?xml version="1.0" encoding="UTF-8" ?>
<install version="1.5" type="plugin" group="vmshipment" method="upgrade">
<name>VMSHIPMENT_RULES_ADV</name>
<creationDate>2014-01-14</creationDate>
<creationDate>2014-01-15</creationDate>
<author>Reinhold Kainhofer</author>
<authorUrl>http://www.open-tools.net</authorUrl>
<copyright>Copyright (C) 2013, Reinhold Kainhofer</copyright>
<copyright>Copyright (C) 2013-2014, Reinhold Kainhofer</copyright>
<license>GPL v3+</license>
<version>4.0.1</version>
<version>4.1</version>
<description>VMSHIPMENT_RULES_ADV_DESC</description>
<files>
<filename plugin="rules_shipping_advanced">rules_shipping_advanced.php</filename>
......
......@@ -262,8 +262,10 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
$method->matched_rule = $match["rule"];
$method->rule_name = $match["rule_name"];
// If NoShipping is set, this method should NOT offer any shipping at all, so return FALSE, otherwise TRUE
// If the rule has a name, print it as warning (otherwise don't print anything)
if ($method->matched_rule->isNoShipping()) {
$this->printWarning(JText::sprintf('VMSHIPMENT_RULES_NOSHIPPING_MESSAGE', $method->rule_name));
if (!empty($method->rule_name))
$this->printWarning(JText::sprintf('VMSHIPMENT_RULES_NOSHIPPING_MESSAGE', $method->rule_name));
vmdebug('checkConditions '.$method->shipment_name.' indicates NoShipping for rule "'.$method->rule_name.'" ('.$method->matched_rule->rulestring.').');
return FALSE;
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment