Changeset 2389547
- Timestamp:
- 09/28/2020 10:34:03 AM (6 years ago)
- Location:
- robera/trunk
- Files:
-
- 5 edited
-
core/background_order_item_copy.php (modified) (2 diffs)
-
core/recommender-admin.php (modified) (1 diff)
-
core/recommender-plugin.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
recommender.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
robera/trunk/core/background_order_item_copy.php
r2389057 r2389547 45 45 // Send the order 46 46 $user_id = $order->get_user_id(); 47 $product = wc_get_product($order_item->get_product_id());48 47 $properties = array( 49 48 'billing_email' => $order->get_billing_email(), … … 62 61 'status' => $order->get_status(), 63 62 'is_paid' => in_array($order->get_status(), wc_get_is_paid_statuses()), 64 'stock_status' => $product->get_stock_status()65 63 ); 66 64 -
robera/trunk/core/recommender-admin.php
r2389057 r2389547 52 52 public function progressPercent($request) 53 53 { 54 if (!get_option('recommender_api_target_order_items', 0)){55 $query = new \WC_Order_Query(array(56 'limit' => -1,57 'offset' => 0,58 ));59 $count=0;60 foreach (array_values($query->get_orders()) as $i => $order) {61 $count+=count($order->get_items());62 }63 update_option('recommender_api_target_order_items', $count);64 }65 54 $library_actions = ['order_item_copy', 'product_copy', 'user_copy']; 66 55 $target_actions = ['order_items', 'products', 'users']; -
robera/trunk/core/recommender-plugin.php
r2387003 r2389547 69 69 add_action('woocommerce_after_cart_item_quantity_update', array(&$this, 'changeCartItemQuantity'), 10, 6 ); 70 70 add_filter('woocommerce_hidden_order_itemmeta', array(&$this,'custom_woocommerce_hidden_order_itemmeta'), 10, 1); 71 add_action( 'woocommerce_thankyou', array(&$this, 'change_product_status'), 10, 1 ); 71 72 } 72 73 } // end of method -> __construct 74 75 function change_product_status($order_id){ 76 if(!$order_id) 77 return; 78 $items = wc_get_order($order_id)->get_items(); 79 foreach ($items as $item) { 80 $item_id = $item->get_product_id(); 81 $this->bg_product_copy->pushToQueue($item_id); 82 $this->bg_product_copy->save()->dispatch(); 83 } 84 } 73 85 74 86 function custom_woocommerce_hidden_order_itemmeta($arr) { … … 499 511 foreach (array_values($orders) as $i => $order) { 500 512 $items = $order->get_items(); 513 update_option( 514 'recommender_api_target_order_items', 515 count($items)+get_option('recommender_api_target_order_items', 0) 516 ); 501 517 foreach ($items as $item) { 502 518 $this->bg_order_item_copy->pushToQueue($item->get_id()); -
robera/trunk/readme.txt
r2389057 r2389547 4 4 License: GPLv2 or later 5 5 License URI: https://www.gnu.org/licenses/gpl-2.0.html 6 Stable tag: 1.0.1 36 Stable tag: 1.0.14 7 7 Tested up to: 5.4.2 8 8 -
robera/trunk/recommender.php
r2389057 r2389547 12 12 * Description: This Plugins help you interact with your WooCommerce users smarter by recommend products and related-products to them according to their preferences. 13 13 * Text Domain: robera-recommender 14 * Version: 1.0.1 314 * Version: 1.0.14 15 15 */ 16 16
Note: See TracChangeset
for help on using the changeset viewer.