Skip to content

Commit

Permalink
Merge pull request #2146 from graphcommerce-org/feature/GCOM-1298
Browse files Browse the repository at this point in the history
[GCOM-1298]: Added configurable details to CartItem via `graphcommerce.config.js`
  • Loading branch information
paales authored Jan 23, 2024
2 parents 5405219 + 3c19305 commit 55430ba
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/shy-gifts-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/magento-product-configurable': patch
---

Display the details of configurable products in the cart.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ fragment ConfigurableCartItem on ConfigurableCartItem @inject(into: ["CartItem"]
}
configured_variant {
uid
...ProductLink
sku
name
sku
thumbnail {
...ProductImage
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ export function ConfigurableCartItemActionCard(
return (
<Prev
{...rest}
cartItem={{
...rest.cartItem,
product: {
...rest.cartItem.product,
name: import.meta.graphCommerce.configurableVariantValues?.content
? rest.cartItem.configured_variant.name
: rest.cartItem.product.name,
thumbnail: rest.cartItem.configured_variant.thumbnail,
// url_key: import.meta.graphCommerce.configurableVariantValues?.url
// ? rest.cartItem.configured_variant.url_key
// : rest.cartItem.product.url_key,
},
}}
details={
<>
{rest.details}
Expand Down

0 comments on commit 55430ba

Please sign in to comment.