Skip to content

C2 subscritions selling plans frontend#1336

Open
hhuang2-godaddy wants to merge 11 commits intogodaddy:mainfrom
hhuang2-godaddy:c2Subscritions_selling_plans_frontend
Open

C2 subscritions selling plans frontend#1336
hhuang2-godaddy wants to merge 11 commits intogodaddy:mainfrom
hhuang2-godaddy:c2Subscritions_selling_plans_frontend

Conversation

@hhuang2-godaddy
Copy link
Copy Markdown

Summary

Changeset

  • Changeset added (docs)

Test Plan

- Added support for fetching and displaying selling plans from an external or local API.
- Introduced `SellingPlanDropdown` component for selecting subscription plans in the product details.
- Updated `ProductDetails` to include selected selling plan information.
- Enhanced cart functionality to handle selling plan details in line items.
- Updated environment configuration to include `SELLING_PLANS_API_URL`.

This implementation allows users to select subscription plans for products, improving the checkout experience.
…integration

- Updated `getSellingPlans` function to handle both SKU IDs and SKU Group IDs for fetching selling plans.
- Modified `SellingPlanDropdown` component to accept `skuGroupId` and adjust fetching logic accordingly.
- Improved error handling and response management in the selling plans API integration.
- Updated product component to pass `skuGroupId` to the dropdown for better plan selection.

These changes streamline the process of selecting selling plans, enhancing the user experience in the product details view.
… dropdown logic

- Updated `getSellingPlans` to remove default API URL fallback.
- Introduced `normalizeCheckoutPrice` function to handle checkout price resolution for selling plans.
- Enhanced `SellingPlanDropdown` to utilize normalized checkout prices when a plan is selected.
- Adjusted `ProductDetails` to reflect selling plan checkout prices in the displayed product pricing.

These changes improve the accuracy of pricing information displayed to users and enhance the overall functionality of the selling plans feature.
…lans

- Streamlined the logic for adding selling plan metafields in the cart functionality.
- Removed commented-out code to enhance code clarity and maintainability.

These changes improve the readability of the `useAddToCart` hook while ensuring the selling plan details are correctly processed.
…plan integration

- Updated the logic for transforming cart line items to include selling plan checkout prices, ensuring consistency with product detail pages.
- Improved the calculation of subtotal and total amounts to reflect the sum of displayed line item prices.
- Streamlined the handling of metafields for selling plans in the `useAddToCart` hook, enhancing clarity and maintainability.

These changes improve the accuracy of pricing information in the cart and align it with the selling plan details, enhancing the overall user experience.
@hhuang2-godaddy hhuang2-godaddy requested a review from a team as a code owner April 1, 2026 18:25
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 1, 2026

⚠️ No Changeset found

Latest commit: 8c7e707

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

hhuang2-godaddy and others added 4 commits April 2, 2026 11:57
…details

- Added a new context provider for managing product detail targets, allowing for extensibility in rendering components at predefined locations.
- Updated the ProductDetails component to utilize the new targets system, replacing the deprecated childrenAboveAddToCart prop.
- Introduced ProductDetailsTarget and ProductDetailsTargetSlot for better management of rendering logic.

These changes enhance the flexibility of the product details component, enabling easier customization and integration of additional features.
…ext for targets

- Refactored import paths in product-details and related components to align with the new structure.
- Introduced a new context provider for managing product detail targets, enhancing the extensibility of the product details component.
- Updated the ProductDetails component to utilize the new targets system, replacing deprecated props.

These changes improve the organization of the codebase and facilitate easier customization of product detail rendering.
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.

2 participants