Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Cart & Popup Logic of Item variant without Website Item #29383

Merged

Conversation

marination
Copy link
Collaborator

@marination marination commented Jan 20, 2022

Fix over #29219

Issue:

  • Lets assume Item Tshirt has many variants which don't need individual Web Pages. We just want the variants to be selected based on Color/Size and added to cart
  • This fix made sure that we don't need a Website Item of variants to select them from the template's web page
  • While getting the exact matched item, it used to try fetch all product details, in which it to fetch Website Item details (in this case variants don't have website items):
    image
  • Another issue was display in shopping cart would also break because it relied on Website Item.

Fix:

To consider: There's only two actions with variants not having a Website Item - add to cart & fetch in popup

  • While getting the exact match in template web item popup, fetch only price details, not entire product details since it's not even used. Only price is used for display
  • For Variant items without Website Items, get web data like image from the template. But get name from Item master itself
  • Below you will see the name is from the Variant Item master, and the image is from the Template Item
    Screenshot 2022-01-20 at 7 46 05 PM

todo:

  • Provide right selling price list to get_price
  • Test full flow from popup to cart

To Test:

  • Against Template Item Tshirt, create a variant Tshirt-Small-Red (keep a human readable item name)
  • Publish the Template Item only
  • Create Item Price for variant Tshirt-Small-Red
  • Go to template item web page > Click on Select Variant > select attributes for variant Tshirt-Small-Red
  • This item should get an exact match and its price should be visible in popup too
  • Add variant to cart
  • Go to cart and check it's name, image and price (if no image in variant item master, it should fetch from template website item). Name should be same as Variant Item master

Try the same flow with another template item whose variant does have a published website item

@marination marination marked this pull request as ready for review January 21, 2022 09:19
@marination marination merged commit f2d8d7a into frappe:version-13-hotfix Jan 21, 2022
@marination
Copy link
Collaborator Author

@Mergifyio backport version-13-pre-release

@mergify
Copy link
Contributor

mergify bot commented Jan 21, 2022

backport version-13-pre-release

✅ Backports have been created

marination added a commit that referenced this pull request Jan 21, 2022
…se/pr-29383

fix: Cart & Popup Logic of Item variant without Website Item (backport #29383)
@marination marination added the e-commerce-fix E-commerce PRs that need to be front ported to develop label Jan 21, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
e-commerce-fix E-commerce PRs that need to be front ported to develop hotfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant