Changeset 2721958
- Timestamp:
- 05/11/2022 11:19:14 AM (4 years ago)
- Location:
- storeman
- Files:
-
- 8 edited
- 1 copied
-
tags/2.1.2 (copied) (copied from storeman/trunk)
-
tags/2.1.2/README.txt (modified) (2 diffs)
-
tags/2.1.2/admin/class-storeman-admin.php (modified) (4 diffs)
-
tags/2.1.2/includes/class-storeman.php (modified) (1 diff)
-
tags/2.1.2/storeman.php (modified) (2 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/class-storeman-admin.php (modified) (4 diffs)
-
trunk/includes/class-storeman.php (modified) (1 diff)
-
trunk/storeman.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
storeman/tags/2.1.2/README.txt
r2701368 r2721958 3 3 Tags: storeman , woocommerce , stock manager , export product , import product , stock, orders, bulk edit products 4 4 Requires at lest: 3.0.1 5 Tested up to: 5.96 Stable tag: 2. 1.15 Tested up to: 6.0 6 Stable tag: 2.2.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 33 33 34 34 == Changelog == 35 = 2. 1.1=35 = 2.2.2 = 36 36 prevent shut down hooks 37 37 = 2.1.0 = -
storeman/tags/2.1.2/admin/class-storeman-admin.php
r2701368 r2721958 122 122 if ( 123 123 in_array($webhook->get_topic(), $this->removeTopic) 124 && 125 ( 126 strpos($webhook->get_delivery_url(), 'storeman') !== false 127 || 128 strpos($webhook->get_delivery_url(), 'stores.com') !== false 129 || 130 strpos($webhook->get_delivery_url(), 'crm.sharpen') !== false 131 ) 132 && $this->removeElementId === $id 124 // && 125 // ( 126 // strpos($webhook->get_delivery_url(), 'storeman') !== false 127 // || 128 // strpos($webhook->get_delivery_url(), 'stores.com') !== false 129 // || 130 // strpos($webhook->get_delivery_url(), 'crm.sharpen') !== false 131 // ) 132 && 133 $this->removeElementId === $id 133 134 ) { 134 135 return false; … … 138 139 protected function checkFromStoreman($request) 139 140 { 140 $h = $request->get_header('user_agent');141 // return true;142 141 return strpos($request->get_header('user_agent'), 'StoreMan') !== false; 143 142 } … … 153 152 { 154 153 if ($this->checkFromStoreman($request)) { 155 $this->removeTopic = ['product.updated','product.created' 156 // ,'product.update_variation' 157 ]; 154 $this->removeTopic = ['product.updated','product.created']; 155 $this->removeElementId = $object->get_id(); 156 } 157 158 return $object; 159 } 160 161 public function set_get_item_schema($c){ 162 if(apply_filters('storeman_stock_quantity_doubleval',false) && isset($c['stock_quantity'])){ 163 $c['stock_quantity']['type'] = 'float'; 164 } 165 return $c; 166 } 167 public function set_doubleval($q) 168 { 169 if (apply_filters('storeman_stock_quantity_doubleval', false)) { 170 remove_filter('woocommerce_stock_amount', 'intval'); 171 return doubleval($q); 172 } 173 return $q; 174 } 175 public function remove_product_variation_webhook_action($object, $request) 176 { 177 if ($this->checkFromStoreman($request)) { 178 $this->removeTopic = ['product.update_variation']; 158 179 $this->removeElementId = $object->get_id(); 159 180 } … … 391 412 } 392 413 } 414 // add_filter('storeman_stock_quantity_doubleval' , function($type){ 415 // return true; 416 // }); 417 -
storeman/tags/2.1.2/includes/class-storeman.php
r2701368 r2721958 182 182 183 183 $this->loader->add_filter( 'rest_product_variation_collection_params',$plugin_admin, 'fix_bath_pp' ); 184 foreach ($post_types as $post_type) { 185 $this->loader->add_action("woocommerce_rest_pre_insert_{$post_type}_object", $plugin_admin, 'remove_product_webhook_action',1,3); 186 $this->loader->add_action("woocommerce_rest_insert_{$post_type}_object", $plugin_admin, 'remove_product_webhook_action',999,3); 187 } 184 // foreach ($post_types as $post_type) { 185 // $this->loader->add_action("woocommerce_rest_pre_insert_product_object", $plugin_admin, 'remove_product_webhook_action',1,3); 186 // $this->loader->add_action("woocommerce_rest_insert_{$post_type}_object", $plugin_admin, 'remove_product_webhook_action',999,3); 187 // } 188 189 $this->loader->add_action("woocommerce_rest_pre_insert_product_object", $plugin_admin, 'remove_product_webhook_action',1,3); 190 $this->loader->add_action("woocommerce_rest_insert_product_object", $plugin_admin, 'remove_product_webhook_action',999,3); 191 192 $this->loader->add_filter('woocommerce_stock_amount',$plugin_admin, 'set_doubleval',1,1); 193 foreach ($post_types as $post_type){ 194 $this->loader->add_filter( 'woocommerce_rest_' . $post_type . '_schema', $plugin_admin,'set_get_item_schema'); 195 } 196 $this->loader->add_action("woocommerce_rest_pre_insert_product_variation_object", $plugin_admin, 'remove_product_variation_webhook_action',1,3); 197 $this->loader->add_action("woocommerce_rest_insert_product_variation_object", $plugin_admin, 'remove_product_variation_webhook_action',999,3); 198 188 199 189 200 } -
storeman/tags/2.1.2/storeman.php
r2701368 r2721958 17 17 * Plugin URI: https://storeman.co.il 18 18 * Description: add storeman to your WordPress site. 19 * Version: 2. 1.119 * Version: 2.2.2 20 20 * Author: avitrop 21 21 * Author URI: https://profiles.wordpress.org/avitrop/ … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'STOREMAN_VERSION', '2. 1.1' );38 define( 'STOREMAN_VERSION', '2.2.2' ); 39 39 40 40 /** -
storeman/trunk/README.txt
r2701368 r2721958 3 3 Tags: storeman , woocommerce , stock manager , export product , import product , stock, orders, bulk edit products 4 4 Requires at lest: 3.0.1 5 Tested up to: 5.96 Stable tag: 2. 1.15 Tested up to: 6.0 6 Stable tag: 2.2.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 33 33 34 34 == Changelog == 35 = 2. 1.1=35 = 2.2.2 = 36 36 prevent shut down hooks 37 37 = 2.1.0 = -
storeman/trunk/admin/class-storeman-admin.php
r2701368 r2721958 122 122 if ( 123 123 in_array($webhook->get_topic(), $this->removeTopic) 124 && 125 ( 126 strpos($webhook->get_delivery_url(), 'storeman') !== false 127 || 128 strpos($webhook->get_delivery_url(), 'stores.com') !== false 129 || 130 strpos($webhook->get_delivery_url(), 'crm.sharpen') !== false 131 ) 132 && $this->removeElementId === $id 124 // && 125 // ( 126 // strpos($webhook->get_delivery_url(), 'storeman') !== false 127 // || 128 // strpos($webhook->get_delivery_url(), 'stores.com') !== false 129 // || 130 // strpos($webhook->get_delivery_url(), 'crm.sharpen') !== false 131 // ) 132 && 133 $this->removeElementId === $id 133 134 ) { 134 135 return false; … … 138 139 protected function checkFromStoreman($request) 139 140 { 140 $h = $request->get_header('user_agent');141 // return true;142 141 return strpos($request->get_header('user_agent'), 'StoreMan') !== false; 143 142 } … … 153 152 { 154 153 if ($this->checkFromStoreman($request)) { 155 $this->removeTopic = ['product.updated','product.created' 156 // ,'product.update_variation' 157 ]; 154 $this->removeTopic = ['product.updated','product.created']; 155 $this->removeElementId = $object->get_id(); 156 } 157 158 return $object; 159 } 160 161 public function set_get_item_schema($c){ 162 if(apply_filters('storeman_stock_quantity_doubleval',false) && isset($c['stock_quantity'])){ 163 $c['stock_quantity']['type'] = 'float'; 164 } 165 return $c; 166 } 167 public function set_doubleval($q) 168 { 169 if (apply_filters('storeman_stock_quantity_doubleval', false)) { 170 remove_filter('woocommerce_stock_amount', 'intval'); 171 return doubleval($q); 172 } 173 return $q; 174 } 175 public function remove_product_variation_webhook_action($object, $request) 176 { 177 if ($this->checkFromStoreman($request)) { 178 $this->removeTopic = ['product.update_variation']; 158 179 $this->removeElementId = $object->get_id(); 159 180 } … … 391 412 } 392 413 } 414 // add_filter('storeman_stock_quantity_doubleval' , function($type){ 415 // return true; 416 // }); 417 -
storeman/trunk/includes/class-storeman.php
r2701368 r2721958 182 182 183 183 $this->loader->add_filter( 'rest_product_variation_collection_params',$plugin_admin, 'fix_bath_pp' ); 184 foreach ($post_types as $post_type) { 185 $this->loader->add_action("woocommerce_rest_pre_insert_{$post_type}_object", $plugin_admin, 'remove_product_webhook_action',1,3); 186 $this->loader->add_action("woocommerce_rest_insert_{$post_type}_object", $plugin_admin, 'remove_product_webhook_action',999,3); 187 } 184 // foreach ($post_types as $post_type) { 185 // $this->loader->add_action("woocommerce_rest_pre_insert_product_object", $plugin_admin, 'remove_product_webhook_action',1,3); 186 // $this->loader->add_action("woocommerce_rest_insert_{$post_type}_object", $plugin_admin, 'remove_product_webhook_action',999,3); 187 // } 188 189 $this->loader->add_action("woocommerce_rest_pre_insert_product_object", $plugin_admin, 'remove_product_webhook_action',1,3); 190 $this->loader->add_action("woocommerce_rest_insert_product_object", $plugin_admin, 'remove_product_webhook_action',999,3); 191 192 $this->loader->add_filter('woocommerce_stock_amount',$plugin_admin, 'set_doubleval',1,1); 193 foreach ($post_types as $post_type){ 194 $this->loader->add_filter( 'woocommerce_rest_' . $post_type . '_schema', $plugin_admin,'set_get_item_schema'); 195 } 196 $this->loader->add_action("woocommerce_rest_pre_insert_product_variation_object", $plugin_admin, 'remove_product_variation_webhook_action',1,3); 197 $this->loader->add_action("woocommerce_rest_insert_product_variation_object", $plugin_admin, 'remove_product_variation_webhook_action',999,3); 198 188 199 189 200 } -
storeman/trunk/storeman.php
r2701368 r2721958 17 17 * Plugin URI: https://storeman.co.il 18 18 * Description: add storeman to your WordPress site. 19 * Version: 2. 1.119 * Version: 2.2.2 20 20 * Author: avitrop 21 21 * Author URI: https://profiles.wordpress.org/avitrop/ … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'STOREMAN_VERSION', '2. 1.1' );38 define( 'STOREMAN_VERSION', '2.2.2' ); 39 39 40 40 /**
Note: See TracChangeset
for help on using the changeset viewer.