Plugin Directory

Changeset 2957362


Ignore:
Timestamp:
08/23/2023 02:07:57 PM (3 years ago)
Author:
outshifter
Message:

small fix handle_save_product

Location:
outshifter-export/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • outshifter-export/trunk/README.txt

    r2954790 r2957362  
    44Requires at least: 5.0
    55Tested up to: 6.2
    6 Stable tag: 3.0
     6Stable tag: 3.1
    77Requires PHP: 7.0
    88License: GPLv3
  • outshifter-export/trunk/index.php

    r2954790 r2957362  
    88 * Author: Reachu
    99 * Author URI: https://reachu.io/
    10  * Version: 3.0
     10 * Version: 3.1
    1111 */
     12
    1213
    1314define('OSEWCPHJC_PLUGIN_PATH', __DIR__);
     
    560561
    561562    public static function handle_save_product($postId)
    562     { //, $post, $update
     563    {
    563564      $updating_post_id = 'update_product_' . $postId;
    564565      if (false === ($updating_post = get_transient($updating_post_id))) {
    565566        $userApiKey = self::getUserApiKey();
    566         if ($userApiKey !== '') {
     567        if (!empty($userApiKey)) {
    567568          $syncEnabled = get_post_meta($postId, OSEWCPHJC_FIELD_SYNC_ENABLED, true);
    568569          self::log('Product ' . $postId . ' sync reachu: ' . $syncEnabled . ' (' . $userApiKey . ')');
     
    572573            self::deleteProductByPostId($postId, $userApiKey);
    573574          }
    574         }
    575         set_transient($updating_post_id, $productId, 5);
    576       }
    577     }
     575        } else {
     576          self::log("No API key found for Product {$postId}. Skipping sync.");
     577      }
     578        set_transient($updating_post_id, $postId, 5);
     579      }
     580    }
     581
    578582
    579583    public static function my_custom_style_reachu()
Note: See TracChangeset for help on using the changeset viewer.