vtex / faststore

Digital commerce toolkit for frontend developers
https://faststore.dev
MIT License
186 stars 58 forks source link

Feat: Add Price with taxes feature #2311

Closed ArthurTriis1 closed 2 months ago

ArthurTriis1 commented 4 months ago

What's the purpose of this pull request?

This PR aims to add the functionality of Price with Taxes, the new feature introduced as part of the Faststore B2B initiative. This feature allows the store shows the product price with taxes included. To learn more about the Price with Taxes and the Faststore B2B initiative, please refer to the RFCs and Product Vision documentation.

B2B Faststore Product Vision B2B Faststore RFC Price With Taxes RFC

How it works?

PriceWithTaxes API fields

This pull request (PR) introduces new fields to the Queries StoreOffer (priceWithTaxes and listPriceWithTaxes) and StoreAggregateOffer (lowPriceWithTaxes). These fields return various price types with taxes included.

These fields will only be displayed if configured for each component in the Headless CMS.

Headless CMS Configuration

To ensure granularity and easy customization of the "price with taxes" feature, fields have been added to the configuration of each section in the Headless CMS. These fields determine whether a particular section should directly use price data with taxes included and specify the label text indicating that the price already includes taxes (the default value for the label is "Tax Included").

The sections that received this configuration in the CMS are: ProductDetails, CartSidebar, ProductTiles, ProductShelf, CrossSellingProductShelf, and ProductGallery.

Screenshot 2024-05-17 at 11 10 55 Taxes Configuration in CMS example

Taxes Label

Based on the Figma prototype, labels were added to components that display prices, indicating that those prices include taxes. Labels were added to the ProductCard and OrderForm components, as well as to the ProductDetails section.

Screenshot 2024-05-17 at 11 17 42 Screenshot 2024-05-17 at 11 18 00 Screenshot 2024-05-17 at 11 17 32

Packing experience adjusts

During the development of the Price With Taxes feature, some improvements were identified for the Packing feature. These improvements are described throughout the PR.

How to test it?

Starters Deploy Preview

The Price with Taxes feature is being used in this preview on b2bfaststoredev preview linked to this PR. In this preview, a 30% tax has been applied to all products. This tax should be applied across the entire store. For comparison, you can use the current b2bfaststoredev link.

References

B2B Faststore Product Vision B2B Faststore RFC Price With Taxes RFC Preview PR b2bfaststoredev

Related Tasks

B2BTEAM-1643 B2BTEAM-1647

vercel[bot] commented 4 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **faststore-site** | ⬜️ Ignored ([Inspect](https://vercel.com/faststore/faststore-site/B1J67RNBpKatyqEAQBSFZHiuKGWB)) | [Visit Preview](https://faststore-site-git-feat-add-price-with-taxes-b-9a5903-faststore.vercel.app) | | Jun 26, 2024 2:49pm |
codesandbox-ci[bot] commented 3 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.