feat(): sync cart translation synced (#14226)
ref: https://github.com/medusajs/medusa/pull/14189 **Summary** This PR extends the translation module to support automatic translation syncing for cart line items based on the cart's locale. Key changes: - Added locale field to the Cart model to store the cart's locale preference - Created new workflow steps: - getTranslatedLineItemsStep - Translates line items when adding to cart or creating a cart - updateCartItemsTranslationsStep - Re-translates all cart items when the cart's locale changes - Integrated translation logic into cart workflows: - createCartWorkflow - Applies translations to initial line items - addToCartWorkflow - Applies translations when adding new items - updateCartWorkflow - Re-translates all items when locale_code is updated - refreshCartItemsWorkflow - Maintains translations during cart refresh - Added applyTranslationsToItems utility to map variant/product/type/collection translations to line item fields (title, subtitle, description, etc.)
This commit is contained in:
committed by
GitHub
parent
356283c359
commit
e4877616c3
@@ -1360,6 +1360,7 @@ medusaIntegrationTestRunner({
|
||||
id: expect.stringContaining("cart_"),
|
||||
sales_channel_id: expect.stringContaining("sc_"),
|
||||
currency_code: "usd",
|
||||
locale: null,
|
||||
region_id: expect.stringContaining("reg_"),
|
||||
shipping_address: null,
|
||||
item_total: 0,
|
||||
|
||||
Reference in New Issue
Block a user