Changeset 2315763
- Timestamp:
- 06/01/2020 10:52:36 AM (6 years ago)
- Location:
- easify-server-woocommerce/trunk
- Files:
-
- 3 edited
-
easify.php (modified) (2 diffs)
-
includes/class-easify-wc-send-order-to-easify.php (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easify-server-woocommerce/trunk/easify.php
r2289263 r2315763 5 5 * Plugin URI: http://www.easify.co.uk/wordpress/ 6 6 * Description: Connects Easify Business Management, EPOS (Electronic Point of Sale) and invoicing software to your WooCommerce enabled WordPress website. Allowing you to keep your online and offline shop's orders and stock control synchronised. 7 * Version: 4. 197 * Version: 4.20 8 8 * License: GPL2 9 9 * License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 12 12 * Requires at least: 4.0 13 13 * Tested up to: 5.4 14 * WC tested up to: 4.1 14 15 */ 15 16 16 17 /** 17 * Copyright (C) 20 19Easify Ltd (email:support@easify.co.uk)18 * Copyright (C) 2020 Easify Ltd (email:support@easify.co.uk) 18 19 * This program is free software; you can redistribute it and/or 19 20 * modify it under the terms of the GNU General Public License -
easify-server-woocommerce/trunk/includes/class-easify-wc-send-order-to-easify.php
r2173054 r2315763 1 1 <?php 2 2 /** 3 * Copyright (C) 20 17Easify Ltd (email:support@easify.co.uk)3 * Copyright (C) 2020 Easify Ltd (email:support@easify.co.uk) 4 4 * This program is free software; you can redistribute it and/or 5 5 * modify it under the terms of the GNU General Public License … … 31 31 * 32 32 * @class Easify_WC_Send_Order_To_Easify 33 * @version 4. 533 * @version 4.20 34 34 * @package easify-woocommerce-connector 35 35 * @author Easify … … 228 228 229 229 // Copy WooCommerce order detail (product) to Easify Order Model order details 230 $easify_order_detail->Sku = $this->get_easify_sku_by_woocommerce_product_id($woocommerce_product['product_id']); 230 231 $variationId = $woocommerce_product['variation_id']; 232 Easify_Logging::Log('Easify_WC_Send_Order_To_Easify.do_order_details() $variationId: ' . $variationId); 233 234 $easify_order_detail->Sku = $this->get_easify_sku_by_woocommerce_product_id($woocommerce_product['product_id'], $variationId); 235 231 236 $easify_order_detail->Qty = $woocommerce_product['qty']; 232 237 $easify_order_detail->Price = round($woocommerce_product['line_subtotal'] / ($woocommerce_product['qty'] == 0 ? 1 : $woocommerce_product['qty']), 4); … … 288 293 * @return integer 289 294 */ 290 private function get_easify_sku_by_woocommerce_product_id($woocommerce_product_id ) {295 private function get_easify_sku_by_woocommerce_product_id($woocommerce_product_id, $variationId) { 291 296 global $wpdb; 292 return $wpdb->get_var($wpdb->prepare( 293 "SELECT meta_value FROM " . $wpdb->postmeta . " WHERE meta_key = '_sku' AND post_id = '%s' LIMIT 1", $woocommerce_product_id 294 )); 297 298 Easify_Logging::Log('Easify_WC_Send_Order_To_Easify.get_easify_sku_by_woocommerce_product_id() ' . 299 ' $woocommerce_product_id: ' . $woocommerce_product_id . 300 ' $variationId: ' . $variationId); 301 302 if ($variationId != '0') 303 { 304 // Have variation - try to get sku 305 $sku = $wpdb->get_var($wpdb->prepare( 306 "SELECT meta_value FROM " . $wpdb->postmeta . 307 " WHERE meta_key = '_sku' AND post_id = '%s' LIMIT 1", $variationId)); 308 309 if ($sku == '') 310 { 311 Easify_Logging::Log('Easify_WC_Send_Order_To_Easify.get_easify_sku_by_woocommerce_product_id() ' . 312 ' variation not found, must be first variation which does not have SKU. Using productId instead.'); 313 314 // First variation doesn't have a SKU, instead use product Id 315 $sku = $wpdb->get_var($wpdb->prepare( 316 "SELECT meta_value FROM " . $wpdb->postmeta . 317 " WHERE meta_key = '_sku' AND post_id = '%s' LIMIT 1", $woocommerce_product_id)); 318 } 319 320 } 321 else 322 { 323 // Not a variation 324 $sku = $wpdb->get_var($wpdb->prepare( 325 "SELECT meta_value FROM " . $wpdb->postmeta . 326 " WHERE meta_key = '_sku' AND post_id = '%s' LIMIT 1", $woocommerce_product_id)); 327 } 328 329 return $sku; 295 330 } 296 331 -
easify-server-woocommerce/trunk/readme.txt
r2289263 r2315763 5 5 Requires at least: 4.0 6 6 Tested up to: 5.4 7 Stable tag: 4. 197 Stable tag: 4.20 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 WC tested up to: 4. 010 WC tested up to: 4.1 11 11 12 12 Connects Easify V4.x Small Business Software to your WooCommerce online shop, … … 101 101 102 102 == Changelog == 103 = 4.20 = 104 * Added support for WooCommerce product variations. See https://www.easify.co.uk/Help/ecommerce-woocommerce-product-variations 103 105 = 4.19 = 104 106 * Added new Product settings options to allow products to be not uploaded from … … 165 167 166 168 == Upgrade Notice == 167 = 4.19 = 168 * Added new Product settings options to allow products to be not uploaded from 169 Easify when first published, also to ignore price and/or stock level changes 170 from Easify. 169 = 4.20 = 170 * Added support for WooCommerce product variations. See https://www.easify.co.uk/Help/ecommerce-woocommerce-product-variations
Note: See TracChangeset
for help on using the changeset viewer.