Changeset 1887530
- Timestamp:
- 06/05/2018 01:29:43 PM (8 years ago)
- Location:
- webwinkelkeur/trunk
- Files:
-
- 3 edited
-
common/woocommerce.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
-
webwinkelkeur.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
webwinkelkeur/trunk/common/woocommerce.php
r1815758 r1887530 68 68 $with_order_data = !get_option($this->get_option_name('limit_order_data')) && is_callable([$order, 'get_data']); 69 69 if ($with_order_data) { 70 $order_arr = $ order->get_data();71 $customer_arr = $order_arr['customer_id'] ? (new WC_Customer($order_arr['customer_id']))->get_data() : [];70 $order_arr = $this->get_data($order, []); 71 $customer_arr = !empty($order_arr['customer_id']) ? $this->get_data(new WC_Customer($order_arr['customer_id']), []) : []; 72 72 $pf = new WC_Product_Factory(); 73 $products = []; 73 74 foreach ($order_arr['line_items'] as $line_item) { 74 75 $product = $pf->get_product($line_item['product_id']); … … 76 77 continue; 77 78 } 78 $product_arr = $ product->get_data();79 $product_arr = $this->get_data($product, []); 79 80 $images = get_attached_media('image', $product->get_id()); 80 81 foreach ($images as $image) { 81 82 $product_arr['product_image'][] = wp_get_attachment_image_src($image->ID, 'full')[0]; 82 83 } 84 $products[] = $product_arr; 83 85 } 84 86 $order_data = [ 85 87 'order' => $order_arr, 86 88 'customer' => $customer_arr, 87 'products' => $product _arr,89 'products' => $products, 88 90 'invoice_address' => $invoice_address, 89 91 'delivery_address' => $delivery_address, … … 142 144 } 143 145 if (is_callable([$value, 'get_data'])) { 144 return $this-> filter_data(@$value->get_data());146 return $this->get_data($value); 145 147 } 146 148 if (is_callable([$value, '__toString'])) { … … 152 154 return $value; 153 155 } 156 157 private function get_data($value, $default = null) { 158 if (!is_callable([$value, 'get_data']) || !is_object($value)) { 159 return $default; 160 } 161 $method = new ReflectionMethod($value, 'get_data'); 162 if ($method->getNumberOfRequiredParameters() > 0) { 163 return $default; 164 } 165 return @$value->get_data(); 166 } 154 167 } -
webwinkelkeur/trunk/readme.txt
r1857959 r1887530 28 28 29 29 == Changelog == 30 31 = 1.6.7 = 32 * Check required parameters before calling get_data(). 30 33 31 34 = 1.6.6 = -
webwinkelkeur/trunk/webwinkelkeur.php
r1857950 r1887530 4 4 Plugin URI: https://www.webwinkelkeur.nl/webwinkel/mogelijkheden/wordpress-module/ 5 5 Description: De WordPress plugin zorgt voor een eenvoudige integratie van het WebwinkelKeur binnen jouw webwinkel. Hiermee is het heel eenvoudig om de innovatieve <a href="https://www.webwinkelkeur.nl/webwinkel/mogelijkheden/sidebar/">WebwinkelKeur Sidebar</a> in jouw WordPress website of WooCommerce webwinkel te integreren. Wanneer je WooCommerce gebruikt, kunnen er bovendien automatisch uitnodigingen naar je klanten worden gestuurd. 6 Version: v1.6. 66 Version: v1.6.7 7 7 Author: Albert Peschar 8 8 Author URI: https://peschar.net/
Note: See TracChangeset
for help on using the changeset viewer.