Changeset 2916533
- Timestamp:
- 05/23/2023 10:50:43 PM (3 years ago)
- Location:
- precious-metals-automated-product-pricing-pro
- Files:
-
- 6 added
- 2 edited
-
tags/2.9.19 (added)
-
tags/2.9.19/WooCommerce_Plugin_Nfusion.php (added)
-
tags/2.9.19/includes (added)
-
tags/2.9.19/includes/nfusion.css (added)
-
tags/2.9.19/includes/nfusion.js (added)
-
tags/2.9.19/readme.txt (added)
-
trunk/WooCommerce_Plugin_Nfusion.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
precious-metals-automated-product-pricing-pro/trunk/WooCommerce_Plugin_Nfusion.php
r2869488 r2916533 11 11 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 12 12 13 * Version: 2.9.1 813 * Version: 2.9.19 14 14 */ 15 define("NFS_CATALOG_PLUGIN_VERSION", "2.9.1 8");15 define("NFS_CATALOG_PLUGIN_VERSION", "2.9.19"); 16 16 define("NFS_CATALOG_REMOTE_TIMEOUT_SECONDS", 2); 17 17 … … 95 95 // Array of product objects 96 96 $products = wc_get_products( $args ); 97 98 foreach($products as $product) { 99 $nfs_sku = get_post_meta($product->get_id(), 'nfs_catalog_plugin_sku', true); 100 $wc_sku = $product->get_sku(); 101 102 $nfsProduct = nfs_catalog_plugin_tryGetProduct(array($nfs_sku, $wc_sku)); 103 if( $nfsProduct !== false ) { 104 $ask = round($nfsProduct['Ask'], 2); 105 $product->set_price((string)$ask); 106 $product->set_regular_price((string)$ask); 107 $product->save(); 97 if($products) 98 { 99 foreach($products as $product) { 100 $nfs_sku = get_post_meta($product->get_id(), 'nfs_catalog_plugin_sku', true); 101 $wc_sku = $product->get_sku(); 102 103 $nfsProduct = nfs_catalog_plugin_tryGetProduct(array($nfs_sku, $wc_sku)); 104 if( $nfsProduct !== false ) { 105 $ask = round($nfsProduct['Ask'], 2); 106 $product->set_price((string)$ask); 107 $product->set_regular_price((string)$ask); 108 $product->save(); 109 } 108 110 } 109 111 } … … 295 297 global $post; 296 298 $product = wc_get_product( $post ); 297 299 if(!$product){ 300 return ''; 301 } 302 298 303 if( $product->is_type( 'variable' ) ) { 299 304 $variations = $product->get_available_variations(); -
precious-metals-automated-product-pricing-pro/trunk/readme.txt
r2869488 r2916533 7 7 Tested up to: 6.1.1 8 8 Requires at least: 3.5.0 9 Stable tag: 2.9.1 89 Stable tag: 2.9.19 10 10 11 11 Automated realtime metals spot and futures data dynamically updates product prices in your store for Gold, Silver, Platinum, and Palladium … … 82 82 83 83 == Changelog == 84 = 2.9.19 = 85 * prevent error from product reference in some pages 86 84 87 = 2.9.18 = 85 88 * supported versions update
Note: See TracChangeset
for help on using the changeset viewer.