Hi.
I am trying to update a Variant into a Product like this:
def create_item(item_data)
product = ShopifyAPI::Product.new(session: @session)
product.title = item_data[:title]
product.body_html = item_data[:body_html]
product.vendor = item_data[:vendor]
product.product_type = item_data[:product_type]
product.variants = item_data[:variants]
# raise StandardError, "Invalid item data: #{format_product_errors(product)}" unless valid_item_data?(product)
product.save!
product
rescue StandardError => e
Rails.logger.error "An error occurred while creating Shopify item: #{e.message}"
nil
end
And this is my product payload for creating/updating
@variants=
[{"sku"=>"CM-HISDTTT",
"price"=>21.0,
"inventory_management"=>"shopify",
"inventory_policy"=>"continue",
"title"=>"CM: HI FROM SAN DIEGO TOTE"},
{"sku"=>"A183185",
"price"=>7.0,
"inventory_management"=>"shopify",
"inventory_policy"=>"continue",
"title"=>"Ray of Sun 2"}],
The problem is, my title on my second variant is never updated. On the first, all works good. I tried everything and the title doesnt change. The same ocurs when trying to update its inventory number. The other elements like SKU, Price, etc… works good.
Any idea on whats happening?