Skip to content

feat(magento-fixed-product-taxes): add new package#2628

Open
paales wants to merge 1 commit into
canaryfrom
feat/magento-fixed-product-taxes
Open

feat(magento-fixed-product-taxes): add new package#2628
paales wants to merge 1 commit into
canaryfrom
feat/magento-fixed-product-taxes

Conversation

@paales
Copy link
Copy Markdown
Member

@paales paales commented May 20, 2026

Summary

New @graphcommerce/magento-fixed-product-taxes package that renders Magento's Fixed Product Taxes (FPT / WEEE / GreenTax) on product pages and inside cart items. Display is driven by Magento's StoreConfig.product_fixed_product_tax_display_setting:

Setting Effect
FPT_DISABLED No FPT rendering.
INCLUDE_FPT_WITHOUT_DETAILS Tax is already in the price; nothing extra is rendered.
INCLUDE_FPT_WITH_DETAILS Show each FPT label + amount next to the price.
EXCLUDE_FPT_WITHOUT_DETAILS Price excludes FPT; nothing extra is rendered.
EXCLUDE_FPT_AND_INCLUDE_WITH_DETAILS Price excludes FPT and the FPT lines are rendered. A final price is shown.

Ported from the unfinished feature/todo-list-paul branch. The cart-item plugin was a stub on the branch (import type only) and has been completed in this PR, following the DownloadableCartItemActionCard pattern.

Activation

PRIVATE_ADDITIONAL_DEPENDENCIES="@graphcommerce/magento-fixed-product-taxes"

Wiring

  • hooks/useFixedProductTaxes.tsx — reads the display setting from store config and returns render flags.
  • plugins/FixedProductTaxesProductPagePrice.tsx — wraps ProductPagePrice and renders the tax breakdown.
  • plugins/FixedProductTaxesCartItem.tsx — wraps CartItemActionCard and adds tax lines into the details slot.
  • Fragment injections add fixed_product_taxes to CartItem + ProductPrice and the three *_fixed_product_tax_display_setting fields to StoreConfigFragment.

Test plan

  • After activating in PRIVATE_ADDITIONAL_DEPENDENCIES, yarn codegen from examples/magento-graphcms generates all 4 .gql.ts files (one fragment + three injects).
  • npx --package=@typescript/native-preview tsgo --noEmit -p . passes (no new errors).
  • Verify in a real example: with FPT-enabled products from a Magento backend, confirm tax lines appear on the product page and in the cart item.

🤖 Generated with Claude Code

New `@graphcommerce/magento-fixed-product-taxes` package that renders
Magento's Fixed Product Taxes (FPT / WEEE / GreenTax) on product pages
and inside cart items. Driven by the store-config display setting:

- `FPT_DISABLED` / `*_WITHOUT_DETAILS` — nothing extra rendered.
- `INCLUDE_FPT_WITH_DETAILS` — per-tax label + amount shown next to the
  price.
- `EXCLUDE_FPT_AND_INCLUDE_WITH_DETAILS` — also appends a "Final price"
  line that adds FPT to the base.

Ports the unfinished package from the `feature/todo-list-paul` branch
and completes the cart-item plugin (which was an empty stub on the
branch). Wiring:

- `hooks/useFixedProductTaxes.tsx` — reads the display setting from
  store config and returns the resulting render flags.
- `plugins/FixedProductTaxesProductPagePrice.tsx` — wraps
  `ProductPagePrice` and renders the tax breakdown.
- `plugins/FixedProductTaxesCartItem.tsx` — wraps `CartItemActionCard`
  and adds tax lines into the `details` slot.
- Fragment injections add the necessary fields to `CartItem`,
  `ProductPrice`, and `StoreConfigFragment` without changing those
  packages.

Activate with
`PRIVATE_ADDITIONAL_DEPENDENCIES="@graphcommerce/magento-fixed-product-taxes"`.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
graphcommerce-246 Ready Ready Preview May 20, 2026 12:25pm
graphcommerce-247 Ready Ready Preview May 20, 2026 12:25pm
graphcommerce-hygraph-dynamic-rows-ui Ready Ready Preview May 20, 2026 12:25pm
graphcommerce-open-source Ready Ready Preview May 20, 2026 12:25pm
graphcommerce-storyblok Ready Ready Preview May 20, 2026 12:25pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

🦋 Changeset detected

Latest commit: 543f491

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 87 packages
Name Type
@graphcommerce/magento-fixed-product-taxes Major
@graphcommerce/docs Major
@graphcommerce/browserslist-config-pwa Major
@graphcommerce/changeset-changelog Major
@graphcommerce/eslint-config-pwa Major
@graphcommerce/graphql-codegen-markdown-docs Major
@graphcommerce/graphql-codegen-near-operation-file Major
@graphcommerce/graphql-codegen-relay-optimizer-plugin Major
@graphcommerce/misc Major
@graphcommerce/next-config Major
@graphcommerce/prettier-config-pwa Major
@graphcommerce/typescript-config-pwa Major
@graphcommerce/address-fields-nl Major
@graphcommerce/algolia-categories Major
@graphcommerce/algolia-insights Major
@graphcommerce/algolia-personalization Major
@graphcommerce/algolia-products Major
@graphcommerce/algolia-recommend Major
@graphcommerce/algolia-search Major
@graphcommerce/cli Major
@graphcommerce/demo-magento-graphcommerce Major
@graphcommerce/ecommerce-ui Major
@graphcommerce/framer-next-pages Major
@graphcommerce/framer-scroller Major
@graphcommerce/framer-utils Major
@graphcommerce/google-datalayer Major
@graphcommerce/google-playstore Major
@graphcommerce/googleanalytics Major
@graphcommerce/googlerecaptcha Major
@graphcommerce/googletagmanager Major
@graphcommerce/graphcms-ui Major
@graphcommerce/graphql-mesh Major
@graphcommerce/graphql Major
@graphcommerce/hygraph-cli Major
@graphcommerce/hygraph-dynamic-rows-ui Major
@graphcommerce/hygraph-dynamic-rows Major
@graphcommerce/hygraph-ui Major
@graphcommerce/image Major
@graphcommerce/lingui-next Major
@graphcommerce/magento-cart-checkout Major
@graphcommerce/magento-cart-coupon Major
@graphcommerce/magento-cart-email Major
@graphcommerce/magento-cart-items Major
@graphcommerce/magento-cart-payment-method Major
@graphcommerce/magento-cart-pickup Major
@graphcommerce/magento-cart-shipping-address Major
@graphcommerce/magento-cart-shipping-method Major
@graphcommerce/magento-cart Major
@graphcommerce/magento-category Major
@graphcommerce/magento-cms Major
@graphcommerce/magento-compare Major
@graphcommerce/magento-customer Major
@graphcommerce/magento-graphql-rest Major
@graphcommerce/magento-graphql Major
@graphcommerce/magento-newsletter Major
@graphcommerce/magento-payment-adyen Major
@graphcommerce/magento-payment-afterpay Major
@graphcommerce/magento-payment-braintree Major
@graphcommerce/magento-payment-included Major
@graphcommerce/magento-payment-klarna Major
@graphcommerce/magento-payment-multisafepay Major
@graphcommerce/magento-payment-paypal Major
@graphcommerce/magento-payment-tokens Major
@graphcommerce/magento-product-bundle Major
@graphcommerce/magento-product-configurable Major
@graphcommerce/magento-product-downloadable Major
@graphcommerce/magento-product-grouped Major
@graphcommerce/magento-product-simple Major
@graphcommerce/magento-product-virtual Major
@graphcommerce/magento-product Major
@graphcommerce/magento-recently-viewed-products Major
@graphcommerce/magento-review Major
@graphcommerce/magento-search-overlay Major
@graphcommerce/magento-search Major
@graphcommerce/magento-store Major
@graphcommerce/magento-wishlist Major
@graphcommerce/mollie-magento-payment Major
@graphcommerce/next-ui Major
@graphcommerce/react-hook-form Major
@graphcommerce/service-worker Major
@graphcommerce/storyblok-ui Major
@graphcommerce/framer-next-pages-example Major
@graphcommerce/framer-scroller-example Major
@graphcommerce/image-example Major
@graphcommerce/magento-graphcms Major
@graphcommerce/magento-open-source Major
@graphcommerce/magento-storyblok Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant