Skip to content

Conversation

@danisal
Copy link
Contributor

@danisal danisal commented May 27, 2025

This PR enhances the price display logic and ensures accurate price calculations across different markets.

  • Implements dynamic price calculation for product variants, considering base, selected, and market-specific prices.
  • Introduces logic to identify and set customer markets, enabling personalized pricing.
  • Rounds discount percentages for clearer display.
  • Removes debug console logs and unused code.

danisal added 8 commits May 27, 2025 16:07
- Added support for displaying lowest and highest prices, with comparisons reflected in the UI.
- Defined pricing logic in a utility function and integrated customer market identification and management.
- Enhanced GraphQL queries to include dynamic price and market data handling.
- The markets API route was deleted as it is no longer needed.
- This cleanup helps streamline the codebase and remove redundant functionality.
- Integrated the `getPrice` utility to calculate and display variant prices dynamically.
- This ensures accurate pricing by considering base, selected, and market prices.
- Updated `Price` component usage to reflect the new price structure.
- Introduce environment variables for price-related configurations: `CRYSTALLIZE_MARKETS_PRICE`, `CRYSTALLIZE_SELECTED_PRICE`, and `CRYSTALLIZE_BASE_PRICE`.
- Enhance the `price` field structure to support additional attributes, improving flexibility and clarity in price handling.
- Previously, discount percentages were not properly rounded, which could lead to minor display inconsistencies.
- This update ensures the percentages are rounded to two decimal places for improved accuracy and presentation.
@vercel
Copy link

vercel bot commented May 27, 2025

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

Name Status Preview Updated (UTC)
nextjs-furnitut ✅ Ready (Inspect) Visit Preview May 28, 2025 8:35am

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.

4 participants