Plugin Directory

Changeset 2916533


Ignore:
Timestamp:
05/23/2023 10:50:43 PM (3 years ago)
Author:
nfusionsolutions
Message:

2.9.19

Location:
precious-metals-automated-product-pricing-pro
Files:
6 added
2 edited

Legend:

Unmodified
Added
Removed
  • precious-metals-automated-product-pricing-pro/trunk/WooCommerce_Plugin_Nfusion.php

    r2869488 r2916533  
    1111 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1212 
    13  * Version: 2.9.18
     13 * Version: 2.9.19
    1414*/
    15 define("NFS_CATALOG_PLUGIN_VERSION",   "2.9.18");
     15define("NFS_CATALOG_PLUGIN_VERSION",   "2.9.19");
    1616define("NFS_CATALOG_REMOTE_TIMEOUT_SECONDS", 2);
    1717
     
    9595    // Array of product objects
    9696    $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            }
    108110        }
    109111    }
     
    295297    global $post;
    296298    $product = wc_get_product( $post );
    297 
     299    if(!$product){
     300        return '';
     301    }
     302   
    298303    if( $product->is_type( 'variable' ) ) {
    299304        $variations = $product->get_available_variations();
  • precious-metals-automated-product-pricing-pro/trunk/readme.txt

    r2869488 r2916533  
    77Tested up to: 6.1.1
    88Requires at least: 3.5.0
    9 Stable tag: 2.9.18
     9Stable tag: 2.9.19
    1010
    1111Automated realtime metals spot and futures data dynamically updates product prices in your store for Gold, Silver, Platinum, and Palladium
     
    8282
    8383== Changelog ==
     84= 2.9.19 =
     85* prevent error from product reference in some pages
     86
    8487= 2.9.18 =
    8588* supported versions update
Note: See TracChangeset for help on using the changeset viewer.