wire Printful shipping rates into cart calculation
Add blueprint_id and print_provider_id to Printful provider_data so the generic shipping calculator can look up rates. Fix v2 API request format (order_items key) and response field names. Fetch one representative variant per product to get accurate per-item rates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -178,6 +178,8 @@ defmodule SimpleshopTheme.Providers.PrintfulTest do
|
||||
|
||||
# Provider data
|
||||
assert normalized.provider_data.catalog_product_id == 71
|
||||
assert normalized.provider_data.blueprint_id == 71
|
||||
assert normalized.provider_data.print_provider_id == 0
|
||||
assert is_list(normalized.provider_data.options)
|
||||
assert length(normalized.provider_data.catalog_variant_ids) == 4
|
||||
end
|
||||
@@ -357,6 +359,8 @@ defmodule SimpleshopTheme.Providers.PrintfulTest do
|
||||
provider_data: %{
|
||||
catalog_product_id: catalog_product_id,
|
||||
catalog_variant_ids: catalog_variant_ids,
|
||||
blueprint_id: catalog_product_id,
|
||||
print_provider_id: 0,
|
||||
thumbnail_url: sync_product["thumbnail_url"],
|
||||
options: build_option_types(sync_variants),
|
||||
raw: %{sync_product: sync_product}
|
||||
|
||||
Reference in New Issue
Block a user