Commit b5948d05 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

V5.2: Fix several minor bugs and PHP warnings. No new features

parent a692f803
......@@ -2,7 +2,7 @@ BASE=rules_shipping
BASE_ADV=rules_shipping_advanced
PLUGINTYPE=vmshipment
ZIPBASE=opentools_vm
VERSION=5.1
VERSION=5.2
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
......
......@@ -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.1</version>
<version>5.2</version>
<description>VMSHIPMENT_RULES_DESC</description>
<files>
<filename plugin="rules_shipping">rules_shipping.php</filename>
......
......@@ -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.1</version>
<version>5.2</version>
<description>VMSHIPMENT_RULES_ADV_DESC</description>
<files>
<filename plugin="rules_shipping_advanced">rules_shipping_advanced.php</filename>
......
......@@ -173,7 +173,10 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
$values['virtuemart_shipmentmethod_id'] = $order['details']['BT']->virtuemart_shipmentmethod_id;
$values['shipment_name'] = $this->renderPluginName ($method);
$values['rule_name'] = $method->rule_name;
// $values['order_weight'] = $this->getOrderWeight ($cart, $method->weight_unit);
$weights = $this->getOrderWeights ($cart, $cart->products, $method->weight_unit);
$values['order_weight'] = $weights['weight'];
$values['order_articles'] = $this->getOrderArticles ($cart, $cart->products);
$values['order_products'] = $this->getOrderProducts ($cart, $cart->products);
$values['shipment_weight_unit'] = $method->weight_unit;
$values['shipment_cost'] = $method->cost;
$values['tax_id'] = $method->tax_id;
......@@ -735,18 +738,18 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
'zip6'=>substr($zip,0,6),
'city'=>isset($address['city'])?trim($address['city']):'',
);
$data['company'] = $address['company'];
$data['title'] = $address['title'];
$data['first_name'] = $address['first_name'];
$data['middle_name'] = $address['middle_name'];
$data['last_name'] = $address['last_name'];
$data['address1'] = $address['address_1'];
$data['address2'] = $address['address_2'];
$data['city'] = $address['city'];
$data['phone1'] = $address['phone_1'];
$data['phone2'] = $address['phone_2'];
$data['fax'] = $address['fax'];
$data['email'] = $address['email'];
$data['company'] = isset($address['company'])?$address['company']:'';
$data['title'] = isset($address['title'])?$address['title']:'';
$data['first_name'] = isset($address['title'])?$address['title']:'';
$data['middle_name'] = isset($address['middle_name'])?$address['middle_name']:'';
$data['last_name'] = isset($address['last_name'])?$address['last_name']:'';
$data['address1'] = isset($address['address_1'])?$address['address_1']:'';
$data['address2'] = isset($address['address_2'])?$address['address_2']:'';
$data['city'] = isset($address['city'])?$address['city']:'';
$data['phone1'] = isset($address['phone_1'])?$address['phone_1']:'';
$data['phone2'] = isset($address['phone_2'])?$address['phone_2']:'';
$data['fax'] = isset($address['fax'])?$address['fax']:'';
$data['email'] = isset($address['email'])?$address['email']:'';
return $data;
}
......@@ -803,7 +806,7 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
}
protected function getCartValues (VirtueMartCart $cart, $products, $method, $cart_prices) {
$address = (($cart->ST == 0 || $cart->STSameAsBT == 1) ? $cart->BT : $cart->ST);
$address = (($cart->ST == 0 || $cart->STsameAsBT == 1) ? $cart->BT : $cart->ST);
$cartvals = array_merge (
array(
'articles'=>$this->getOrderArticles($cart, $products),
......@@ -932,6 +935,7 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
// Try to parse all rules (and spit out error) to inform the user. There is no other
// reason to parse the rules here, it's really only to trigger warnings/errors in case of a syntax error.
$method = new StdClass ();
$method->virtuemart_shipmentmethod_id = $data['virtuemart_shipmentmethod_id'];
$this->parseMethodRule ($data['rules1'], isset($data['countries1'])?$data['countries1']:array(), $data['tax_id1'], $method);
$this->parseMethodRule ($data['rules2'], isset($data['countries2'])?$data['countries2']:array(), $data['tax_id2'], $method);
$this->parseMethodRule ($data['rules3'], isset($data['countries3'])?$data['countries3']:array(), $data['tax_id3'], $method);
......
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