Changeset 3105284
- Timestamp:
- 06/20/2024 05:57:44 PM (22 months ago)
- Location:
- product-feeder/trunk
- Files:
-
- 3 edited
-
includes/product-feeder.php (modified) (7 diffs)
-
product-feeder.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
product-feeder/trunk/includes/product-feeder.php
r3104111 r3105284 9 9 10 10 private $WPMLActive = false; 11 private $AttributeValues = array(); 11 12 private $AttributeTaxonomies = NULL; 12 13 private $AttributeDisplayValues = array(); … … 501 502 } 502 503 503 private function GetCustomFields($ ID, $type) {504 private function GetCustomFields($Product, $type) { 504 505 $CustomFields = array(); 505 506 if ($this->AttributeTaxonomies === NULL) { … … 507 508 foreach ($all_attribute_taxonomies as $attribute_taxonomy) $this->AttributeTaxonomies[$attribute_taxonomy->attribute_name] = $attribute_taxonomy->attribute_label; 508 509 } 509 $product_meta = get_post_meta($ ID);510 $product_meta = get_post_meta($Product->get_id()); 510 511 foreach ($product_meta as $meta_key => $meta_value) { 511 512 if (!empty($meta_value[0])) { 512 513 if ($meta_key == '_product_attributes') { 513 $_product_attributes = unserialize($meta_value[0]); 514 foreach ($_product_attributes as $_product_attribute) { 515 $product_attribute_name = str_replace('pa_', '', $_product_attribute['name']); 516 if (isset($this->AttributeTaxonomies[$product_attribute_name])) { 517 if (empty($CustomFields['Attributes'])) $CustomFields['Attributes'] = array(); 518 $CustomFields['Attributes'][$product_attribute_name] = $this->AttributeTaxonomies[$product_attribute_name]; 514 foreach ($Product->get_attributes() as $attr_name => $attr_data) { 515 $attr_data = $attr_data->get_data(); 516 if (!empty($attr_data['options'])) { 517 $attr_name_short = str_replace('pa_', '', $attr_name); 518 if (isset($this->AttributeTaxonomies[$attr_name_short])) { 519 if (empty($CustomFields['Attributes'])) $CustomFields['Attributes'] = array(); 520 $CustomFields['Attributes'][$this->AttributeTaxonomies[$attr_name_short]] = array(); 521 foreach ($attr_data['options'] as $term_id) { 522 if (!isset($this->AttributeValues[$term_id])) $this->AttributeValues[$term_id] = get_term($term_id); 523 if (isset($this->AttributeValues[$term_id]) && isset($this->AttributeValues[$term_id]->name)) $CustomFields['Attributes'][$this->AttributeTaxonomies[$attr_name_short]][] = $this->AttributeValues[$term_id]->name; 524 } 525 } 519 526 } 520 527 } … … 528 535 if ($this->WPMLActive) { 529 536 if ($type == 'product') { 530 $LanguageDetails = apply_filters('wpml_post_language_details', NULL, $ ID);537 $LanguageDetails = apply_filters('wpml_post_language_details', NULL, $Product->get_id()); 531 538 if (isset($LanguageDetails['language_code'])) { 532 539 foreach ($LanguageDetails as $WPMLKey => $WPMLValue) { … … 594 601 "Categories" => $this->GetCategoryPaths($ProductID), 595 602 "Variations" => array(), 596 "CustomFields" => $this->GetCustomFields($Product ID, 'product'),603 "CustomFields" => $this->GetCustomFields($Product, 'product'), 597 604 "Updated" => get_the_modified_date('Y-m-d\TH:i:sT', $ProductID), 598 605 ); … … 709 716 "Stock" => (int)$variation_data['stock_quantity'], 710 717 "Images" => $ImageLinks, 711 "CustomFields" => $this->GetCustomFields($Variation ID, 'variation'),718 "CustomFields" => $this->GetCustomFields($Variation, 'variation'), 712 719 "Updated" => get_the_modified_date('Y-m-d\TH:i:sT', $VariationID), 713 720 ); … … 788 795 "Stock" => (int)$Product->get_stock_quantity(), 789 796 "Images" => $ProductData['Images'], 790 "CustomFields" => $this->GetCustomFields($Product Data['ID'], 'product'),797 "CustomFields" => $this->GetCustomFields($Product, 'product'), 791 798 "Updated" => $ProductData['Updated'], 792 799 ); -
product-feeder/trunk/product-feeder.php
r3104111 r3105284 3 3 * Plugin Name: Product Feeder 4 4 * Description: Connect to the marketplace(s) of your choice to increase sales, synchronize orders & returns, rule-based product selection, and much more! 5 * Version: 2.4. 55 * Version: 2.4.6 6 6 * Author: Product Feeder 7 7 * Author URI: https://product-feeder.com -
product-feeder/trunk/readme.txt
r3104111 r3105284 5 5 Requires at least: 6.0 6 6 Tested up to: 6.4 7 Stable tag: 2.4. 57 Stable tag: 2.4.6 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 123 123 = 2.4.5 = 124 124 * Updated season support 125 126 = 2.4.6 = 127 * Updated taxonomy support
Note: See TracChangeset
for help on using the changeset viewer.