Changeset 3384241
- Timestamp:
- 10/24/2025 09:25:42 PM (5 months ago)
- Location:
- precious-metals-automated-product-pricing-pro
- Files:
-
- 51 added
- 11 edited
-
tags/4.0.3 (added)
-
tags/4.0.3/WooCommerce_Plugin_Nfusion.php (added)
-
tags/4.0.3/assets (added)
-
tags/4.0.3/assets/css (added)
-
tags/4.0.3/assets/css/nfusion-admin-menu.css (added)
-
tags/4.0.3/assets/css/nfusion-admin-product-list.css (added)
-
tags/4.0.3/assets/css/nfusion-admin.css (added)
-
tags/4.0.3/assets/css/nfusion-frontend-product.css (added)
-
tags/4.0.3/assets/img (added)
-
tags/4.0.3/assets/img/nfusion-icon.svg (added)
-
tags/4.0.3/assets/js (added)
-
tags/4.0.3/assets/js/nfusion-admin-product-list.js (added)
-
tags/4.0.3/assets/js/nfusion-admin-product-sync.js (added)
-
tags/4.0.3/assets/js/nfusion-admin-settings.js (added)
-
tags/4.0.3/assets/js/nfusion-frontend-product.js (added)
-
tags/4.0.3/includes (added)
-
tags/4.0.3/includes/admin (added)
-
tags/4.0.3/includes/admin/class-admin-enqueue.php (added)
-
tags/4.0.3/includes/admin/class-admin-plugin-feedback.php (added)
-
tags/4.0.3/includes/admin/class-admin-plugin-settings.php (added)
-
tags/4.0.3/includes/admin/class-admin-product-list.php (added)
-
tags/4.0.3/includes/admin/class-admin-product-meta.php (added)
-
tags/4.0.3/includes/admin/class-admin-product-sync.php (added)
-
tags/4.0.3/includes/admin/class-product-list-table.php (added)
-
tags/4.0.3/includes/admin/class-product-reindexing.php (added)
-
tags/4.0.3/includes/client (added)
-
tags/4.0.3/includes/client/class-catalog-client.php (added)
-
tags/4.0.3/includes/constants.php (added)
-
tags/4.0.3/includes/constants.php.bak (added)
-
tags/4.0.3/includes/frontend (added)
-
tags/4.0.3/includes/frontend/class-frontend-enqueue.php (added)
-
tags/4.0.3/includes/frontend/class-frontend-product.php (added)
-
tags/4.0.3/includes/frontend/class-frontend-summary.php (added)
-
tags/4.0.3/includes/frontend/class-frontend-woo-checkout.php (added)
-
tags/4.0.3/includes/helpers.php (added)
-
tags/4.0.3/includes/model (added)
-
tags/4.0.3/includes/model/class-api-result.php (added)
-
tags/4.0.3/includes/model/class-product-meta.php (added)
-
tags/4.0.3/includes/model/class-product-settings.php (added)
-
tags/4.0.3/includes/model/class-settings-api-request.php (added)
-
tags/4.0.3/includes/model/class-sync-result.php (added)
-
tags/4.0.3/includes/model/class-transient.php (added)
-
tags/4.0.3/includes/service (added)
-
tags/4.0.3/includes/service/class-action-scheduler-service.php (added)
-
tags/4.0.3/includes/service/class-cache-service.php (added)
-
tags/4.0.3/includes/service/class-catalog-service.php (added)
-
tags/4.0.3/includes/service/class-product-sync-service.php (added)
-
tags/4.0.3/includes/service/class-product-validator.php (added)
-
tags/4.0.3/includes/service/class-response-handler.php (added)
-
tags/4.0.3/includes/service/class-woocommerce-service.php (added)
-
tags/4.0.3/readme.txt (added)
-
trunk/WooCommerce_Plugin_Nfusion.php (modified) (1 diff)
-
trunk/includes/admin/class-admin-product-meta.php (modified) (3 diffs)
-
trunk/includes/admin/class-admin-product-sync.php (modified) (5 diffs)
-
trunk/includes/admin/class-product-reindexing.php (modified) (1 diff)
-
trunk/includes/client/class-catalog-client.php (modified) (1 diff)
-
trunk/includes/constants.php (modified) (1 diff)
-
trunk/includes/frontend/class-frontend-product.php (modified) (1 diff)
-
trunk/includes/frontend/class-frontend-summary.php (modified) (2 diffs)
-
trunk/includes/helpers.php (modified) (2 diffs)
-
trunk/includes/model/class-settings-api-request.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
precious-metals-automated-product-pricing-pro/trunk/WooCommerce_Plugin_Nfusion.php
r3378387 r3384241 11 11 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 12 12 13 * Version: 4.0. 213 * Version: 4.0.3 14 14 */ 15 15 -
precious-metals-automated-product-pricing-pro/trunk/includes/admin/class-admin-product-meta.php
r3374553 r3384241 152 152 } 153 153 } else { 154 // Search for product using nfs_ sku or wc_sku giving priority to nfs_sku155 $connected = NFS_Catalog_Service::try_get_product([$product->get_meta('nfs_ sku', true), $product->get_sku()]) !== false;154 // Search for product using nfs_catalog_plugin_sku or wc_sku giving priority to nfs_catalog_plugin_sku 155 $connected = NFS_Catalog_Service::try_get_product([$product->get_meta('nfs_catalog_plugin_sku', true), $product->get_sku()]) !== false; 156 156 if ($connected) { 157 157 echo '<p><span class="dashicons dashicons-yes-alt" style="color:#46b450;"></span> <strong>' . esc_html__('Connected', 'precious-metals-automated-product-pricing-pro') . '</strong></p>'; … … 203 203 global $post; 204 204 woocommerce_wp_text_input([ 205 'id' => 'nfs_ sku',205 'id' => 'nfs_catalog_plugin_sku', 206 206 'label' => __('nFusion SKU', 'precious-metals-automated-product-pricing-pro'), 207 207 'desc_tip' => true, 208 208 'description' => __('This SKU should match the one in your Product Catalog.', 'your-textdomain'), 209 'value' => get_post_meta($post->ID, 'nfs_ sku', true),209 'value' => get_post_meta($post->ID, 'nfs_catalog_plugin_sku', true), 210 210 ]); 211 211 } … … 213 213 // Save nfusion sku field value 214 214 public static function save_nfusion_sku_field($post_id) { 215 $sku = isset($_POST['nfs_ sku']) ? sanitize_text_field($_POST['nfs_sku']) : '';216 update_post_meta($post_id, 'nfs_ sku', $sku);215 $sku = isset($_POST['nfs_catalog_plugin_sku']) ? sanitize_text_field($_POST['nfs_catalog_plugin_sku']) : ''; 216 update_post_meta($post_id, 'nfs_catalog_plugin_sku', $sku); 217 217 } 218 218 -
precious-metals-automated-product-pricing-pro/trunk/includes/admin/class-admin-product-sync.php
r3374553 r3384241 334 334 if (!$product) continue; 335 335 $wc_sku = trim((string) $product->get_sku()); 336 $nfs_sku = trim((string) get_post_meta($product->get_id(), 'nfs_ sku', true));336 $nfs_sku = trim((string) get_post_meta($product->get_id(), 'nfs_catalog_plugin_sku', true)); 337 337 $effective = NFS_Catalog_Helpers::get_nfs_sku($product); 338 338 … … 475 475 $product = $woo_products[$sku]; 476 476 $wc_sku = strpos($sku, 'no_sku_') === 0 ? '' : trim((string) $product->get_sku()); 477 $nfs_sku = trim((string) get_post_meta($product->get_id(), 'nfs_sku', true));477 $nfs_sku = trim((string) $product->get_meta('nfs_catalog_plugin_sku', true)); 478 478 $effective = NFS_Catalog_Helpers::get_nfs_sku($product); 479 479 … … 578 578 $keys = []; 579 579 $wc = trim((string) $product->get_sku()); 580 $nfs = trim((string) get_post_meta($product->get_id(), 'nfs_sku', true));580 $nfs = trim((string) $product->get_meta('nfs_catalog_plugin_sku', true)); 581 581 if ($wc !== '') $keys[] = $wc; if ($nfs !== '') $keys[] = $nfs; 582 582 foreach ($keys as $k) { if (isset($catalog[$k])) { $count++; break; } } … … 594 594 foreach ($woo_list as $product) { 595 595 $wc = trim((string) $product->get_sku()); 596 $nfs = trim((string) get_post_meta($product->get_id(), 'nfs_sku', true));596 $nfs = trim((string) $product->get_meta('nfs_catalog_plugin_sku', true)); 597 597 if ($wc !== '' && isset($catalog[$wc])) { $matched_cat_keys[$wc] = true; } 598 598 if ($nfs !== '' && isset($catalog[$nfs])) { $matched_cat_keys[$nfs] = true; } … … 615 615 if (!$product) continue; 616 616 $wc = trim((string) $product->get_sku()); 617 $nfs = trim((string) get_post_meta($product->get_id(), 'nfs_sku', true));617 $nfs = trim((string) $product->get_meta('nfs_catalog_plugin_sku', true)); 618 618 $matched = false; 619 619 if ($wc !== '' && isset($catalog[$wc])) $matched = true; -
precious-metals-automated-product-pricing-pro/trunk/includes/admin/class-product-reindexing.php
r3374553 r3384241 37 37 } 38 38 } else { 39 $nfs_sku = $product->get_meta('nfs_sku', true);39 $nfs_sku = trim((string) $product->get_meta('nfs_catalog_plugin_sku', true)); 40 40 $wc_sku = $product->get_sku(); 41 41 $nfsProduct = NFS_Catalog_Service::try_get_product(array($nfs_sku, $wc_sku)); -
precious-metals-automated-product-pricing-pro/trunk/includes/client/class-catalog-client.php
r3374553 r3384241 180 180 } 181 181 182 $payload = (is_object($body) && method_exists($body, 'toArray')) ? $body->toArray() : $body; 183 182 184 $response = wp_remote_post($url, [ 183 185 'timeout' => defined('NFS_CATALOG_REMOTE_TIMEOUT_SECONDS') ? NFS_CATALOG_REMOTE_TIMEOUT_SECONDS : 20, 184 186 'headers' => $headers, 185 'body' => json_encode($body),187 'body' => wp_json_encode($payload), 186 188 'sslverify' => false, // Disable SSL verification for local development TODO: Remove in production 187 189 ]); -
precious-metals-automated-product-pricing-pro/trunk/includes/constants.php
r3378387 r3384241 1 1 <?php 2 define("NFS_CATALOG_PLUGIN_VERSION", "4.0. 2");2 define("NFS_CATALOG_PLUGIN_VERSION", "4.0.3"); 3 3 define("NFS_CATALOG_PLUGIN_BASENAME", plugin_basename(__FILE__)); 4 4 define("NFS_FEEDBACK_REQUEST_DISMISSED", "nfs_feedback_dismissed"); -
precious-metals-automated-product-pricing-pro/trunk/includes/frontend/class-frontend-product.php
r3374553 r3384241 18 18 */ 19 19 public static function get_price($price, $product) { 20 $nfs_sku = $product->get_meta('nfs_sku');20 $nfs_sku = trim((string) $product->get_meta('nfs_catalog_plugin_sku', true)); 21 21 $wc_sku = $product->get_sku(); 22 22 $nfsProduct = NFS_Catalog_Service::try_get_product([$nfs_sku, $wc_sku]); -
precious-metals-automated-product-pricing-pro/trunk/includes/frontend/class-frontend-summary.php
r3374553 r3384241 11 11 return $priceHtml; 12 12 } 13 $nfs_sku = $product->get_meta('nfs_sku');13 $nfs_sku = trim((string) $product->get_meta('nfs_catalog_plugin_sku', true)); 14 14 $wc_sku = $product->get_sku(); 15 15 $nfsProduct = NFS_Catalog_Service::try_get_product([$nfs_sku, $wc_sku]); … … 66 66 } 67 67 } else { 68 $nfs_sku = $product->get_meta('nfs_sku');68 $nfs_sku = trim((string) $product->get_meta('nfs_catalog_plugin_sku', true)); 69 69 $wc_sku = $product->get_sku(); 70 70 $nfsProduct = NFS_Catalog_Service::try_get_product([$nfs_sku, $wc_sku]); -
precious-metals-automated-product-pricing-pro/trunk/includes/helpers.php
r3374553 r3384241 110 110 * 111 111 * For variations, it always uses the WooCommerce SKU. 112 * For simple products, it prefers the 'nfs_sku' meta if set, otherwise uses the WooCommerce SKU.112 * For simple products, it prefers the legacy 'nfs_catalog_plugin_sku' meta if set, otherwise uses the WooCommerce SKU. 113 113 * 114 114 * @param WC_Product $product The product object. … … 123 123 return trim($wc_sku); 124 124 } 125 // For simple/parent products, prefer nfs_sku if set, otherwise WooCommerce SKU 126 $product_id = method_exists($product, 'get_id') ? $product->get_id() : 0; 127 $nfs_sku = trim((string) get_post_meta($product_id, 'nfs_sku', true)); 125 // For simple/parent products, prefer nfs_catalog_plugin_sku if set, otherwise WooCommerce SKU 126 $nfs_sku = method_exists($product, 'get_meta') ? trim((string) $product->get_meta('nfs_catalog_plugin_sku', true)) : ''; 128 127 if ($nfs_sku !== '') { return $nfs_sku; } 129 128 $wc_sku = method_exists($product, 'get_sku') ? trim((string) $product->get_sku()) : ''; 130 129 return $wc_sku; 131 } 130 } 132 131 133 132 /** -
precious-metals-automated-product-pricing-pro/trunk/includes/model/class-settings-api-request.php
r3374553 r3384241 1 1 <?php 2 2 3 class NFS_Settings_Api_Request implements JsonSerializable{3 class NFS_Settings_Api_Request { 4 4 /** @var string */ 5 5 public $token; … … 13 13 14 14 /** 15 * This tells json_encode() how to turn this object into JSON. 16 * We return an associative array with exactly the keys we want. 15 * Build the payload array for API requests. 17 16 */ 18 public function jsonSerialize(): mixed{17 public function toArray(): array { 19 18 return [ 20 19 'Token' => $this->token, 21 20 'Items' => array_map( 22 fn($item) => is_array($item) ? $item : $item->toPascalArray(),21 fn($item) => is_array($item) ? $item : (method_exists($item, 'toPascalArray') ? $item->toPascalArray() : $item), 23 22 $this->items 24 23 ), -
precious-metals-automated-product-pricing-pro/trunk/readme.txt
r3378387 r3384241 7 7 Tested up to: 6.8.3 8 8 Requires at least: 3.5.0 9 Stable tag: 4.0. 29 Stable tag: 4.0.3 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 = 4.0.3 = 85 * Fix legacy nFusion SKU metadata name during retrieval 84 86 85 87 = 4.0.2 =
Note: See TracChangeset
for help on using the changeset viewer.