Skip to content
Snippets Groups Projects
Commit 307f44de authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

WC3 compatibility: Change all order property extractions to use the proper...

WC3 compatibility: Change all order property extractions to use the proper getter functions (works in WC 2.6, too).
parent 82e980a1
No related branches found
No related tags found
No related merge requests found
...@@ -150,9 +150,9 @@ class RulesShippingFrameworkWooCommerce extends RulesShippingFramework { ...@@ -150,9 +150,9 @@ class RulesShippingFrameworkWooCommerce extends RulesShippingFramework {
); );
foreach ($products as $product) { foreach ($products as $product) {
$l = $product['data']->length; $l = $product['data']->get_length();
$w = $product['data']->width; $w = $product['data']->get_width();
$h = $product['data']->height; $h = $product['data']->get_height();
$volume = $l * $w * $h; $volume = $l * $w * $h;
$dimensions['volume'] += $volume * $product['quantity']; $dimensions['volume'] += $volume * $product['quantity'];
...@@ -193,7 +193,7 @@ class RulesShippingFrameworkWooCommerce extends RulesShippingFramework { ...@@ -193,7 +193,7 @@ class RulesShippingFrameworkWooCommerce extends RulesShippingFramework {
$tags = array(); $tags = array();
$shipping_classes = array(); $shipping_classes = array();
foreach ($products as $product) { foreach ($products as $product) {
$id = $product['data']->id; $id = $product['data']->get_id();
if ($product['data']->get_sku()) { if ($product['data']->get_sku()) {
$skus[] = $product['data']->get_sku(); $skus[] = $product['data']->get_sku();
} }
...@@ -249,7 +249,7 @@ class RulesShippingFrameworkWooCommerce extends RulesShippingFramework { ...@@ -249,7 +249,7 @@ class RulesShippingFrameworkWooCommerce extends RulesShippingFramework {
$vendorids = array(); $vendorids = array();
// The plugin provides its own function to retrieve the vendor for a product // The plugin provides its own function to retrieve the vendor for a product
foreach ($products as $product) { foreach ($products as $product) {
foreach (get_product_vendors($product['data']->id) as $vendor) { foreach (get_product_vendors($product['data']->get_id()) as $vendor) {
// $this->printWarning("<pre>vendor: ".print_r($vendor,1)."</pre>"); // $this->printWarning("<pre>vendor: ".print_r($vendor,1)."</pre>");
$vendors[] = $vendor->slug; $vendors[] = $vendor->slug;
$vendornames[] = $vendor->title; $vendornames[] = $vendor->title;
...@@ -268,7 +268,7 @@ class RulesShippingFrameworkWooCommerce extends RulesShippingFramework { ...@@ -268,7 +268,7 @@ class RulesShippingFrameworkWooCommerce extends RulesShippingFramework {
$vendorids = array(); $vendorids = array();
// The plugin provides its own function to retrieve the vendor for a product // The plugin provides its own function to retrieve the vendor for a product
foreach ($products as $product) { foreach ($products as $product) {
$vendor = yith_get_vendor($product['data']->id, 'product'); $vendor = yith_get_vendor($product['data']->get_id(), 'product');
// $this->printWarning("<pre>vendor: ".print_r($vendor,1)."</pre>"); // $this->printWarning("<pre>vendor: ".print_r($vendor,1)."</pre>");
if ($vendor->is_valid()) { if ($vendor->is_valid()) {
$vendors[] = $vendor->slug; $vendors[] = $vendor->slug;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment