Bug Fixes

Profile Conversion and Feed Generation

Fixed: Legacy attribute form displaying for converted profiles
Resolved issue where the legacy attribute form would appear on product pages even after the profile had been converted to use the new JSON feed format. Added proper detection to ensure only the appropriate attribute interface is displayed based on the profile type.

Fixed: Edge case allowing both legacy and JSON feeds to be generated simultaneously
Closed a workflow edge case that could cause both legacy and JSON format feeds to be generated for the same listing. Enhanced feed generation logic to ensure only the appropriate feed type is created based on profile configuration.

Fixed: Feed being generated using old profile after switching profiles
Corrected evaluation order in JsonFeedDataBuilder to load profile fields before product type checks. This ensures the current profile’s settings are always used when generating feeds, preventing submission of outdated attribute values.

Fixed: Cannot access offset of type string on string during profile conversion
Added type validation in ProfileProductTypeConverter.convertFromArray() to handle non-array inputs gracefully. The converter now checks if fields is actually an array before attempting to access array elements, preventing “Cannot access offset” errors when encountering strings or null values.

Currency and Pricing

Fixed: Missing currency value for the list_price property
Ensured currency values are properly included with list_price in JSON feeds. Amazon’s product type schemas require both amount and currency code for pricing fields. The price construction logic now guarantees currency is present for all pricing properties.

Fixed: Use the default schema currency if not set in profile
Added fallback to use the default currency defined in the product type schema when a specific currency hasn’t been configured in the profile. This ensures all pricing fields include valid currency information even when not explicitly mapped.

Fixed: Do not send Sale Price value and dates when Sale Price is unmapped
Corrected handling of unmapped sale price fields. When sale price is explicitly unmapped ([—]) or empty in the profile configuration, the entire discounted_price structure is now omitted from the feed, preventing validation errors from orphaned sale date ranges.

Fixed: Skip filling the sale date from and to if Sale Price is set to stay empty
Enhanced sale date handling to check profile field configuration for the sale price property before including sale start/end dates. This prevents sale date fields from being populated when there’s no sale price to accompany them.

Data Validation and Type Handling

Fixed: Added the compatibility_options property to the reindexArrays() method
Extended the reindexArrays() method to handle compatibility_options arrays (used for vehicle fitment and similar compatibility data). Arrays with gaps in their indices now have their keys properly reindexed to be sequential, preventing Amazon validation errors.

Fixed: Convert date format from YYYY/MM/DD to YYYY-MM-DD
Added WPLA_DateTimeHelper::convertDateFormatForAmazon() to automatically convert various date formats to Amazon’s required YYYY-MM-DD format. Handles MM/DD/YYYY, DD/MM/YYYY, and other common formats, ensuring date fields always validate correctly.

Fixed: Map legacy Item Condition values to use the new condition strings
Added wpla_convert_legacy_item_condition() function to automatically convert legacy condition codes to the new format required by JSON feeds. Maps values like “UsedLikeNew” to “used_like_new”, “CollectibleGood” to “collectible_good”, etc.

Listing and Feed Management

Fixed: Remove listings from queue that fails the canSubmitListing() check
Modified queue processing in WPLA_CronActions to remove failed listings from the publishing queue instead of stopping entire queue processing. Changed from return to continue with explicit queue removal call, allowing subsequent listings to be processed even when one fails validation.

Fixed: Handling Time must be removed for FBA listings
Implemented logic to automatically omit handling_time from listings fulfilled by Amazon (FBA). While handling time is required for Seller Fulfilled (FBM) listings, including it for FBA listings causes validation errors since Amazon controls the fulfillment timeline.

Fixed: Custom Size Map table failing to save when field name contains square brackets
Corrected handling of field names containing square bracket notation in the Custom Size Map table (commonly used in apparel categories). The save handler now properly escapes these characters, allowing size mapping configurations with bracket notation to save correctly.

Files Modified

  • classes/core/WPLA_CronActions.php – Queue processing improvements
  • classes/core/WPLA_Functions.php – Added legacy condition conversion function
  • classes/helper/JsonFeedDataBuilder.php – Profile evaluation order, sale price handling, FBA logic
  • classes/helper/ProfileProductTypeConverter.php – Type validation, date conversion
  • classes/helper/WPLA_DateTimeHelper.php – Added date format conversion method
  • classes/integration/Woo_ProductMetaBox.php – Profile type detection
  • classes/integration/Woo_Product_Feed_MetaBox.php – Attribute form display logic
  • classes/model/AmazonFeed.php – Feed type selection
  • classes/model/ListingsModel.php – Queue management
  • classes/page/ProfileConverterPage.php – Conversion UI improvements
  • classes/page/SettingsPage.php – Custom Size Map handling
  • views/settings_advanced.php – Settings interface updates

Technical Details

This release primarily addresses edge cases and data validation issues discovered during the migration from legacy Amazon listing profiles to the new product type schema system. The majority of fixes relate to ensuring data types, formats, and field mappings are correctly handled during profile conversion and feed generation.

Key technical improvements include:

  • Enhanced type checking throughout the profile conversion system
  • Improved conditional logic for omitting unmapped or FBA-inappropriate fields
  • Automatic data format conversion (dates, condition codes, array indices)
  • Better separation between legacy and JSON feed generation paths
  • More robust queue processing that doesn’t halt on individual listing failures