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

New variants should inherit tax category in UI #13068

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vishaldeepak
Copy link
Contributor

What? Why?

Creation of a new variant was setting tax category as none. This is problematic for any hub selling taxable products. The fix is on creating a new variant in the UI it should set tax category from the first variant.

What should we test?

  • Visit page. - /admin/products
  • Create a new variant for any product that already has tax category set for its first variant.

After changes it should behave similar to below

opennetwork.mov

Release notes

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes
  • API changes (V0, V1, DFC or Webhook)
  • Technical changes only
  • Feature toggled

The title of the pull request will be included in the release notes.

Dependencies

Documentation updates

@sigmundpetersen sigmundpetersen changed the title New varaints should inherit tax category in UI New variants should inherit tax category in UI Jan 10, 2025
@@ -14,6 +14,7 @@ def prepare_new_variant(product, producer_options)
# e.g producer_options = [['producer name', id]]
product.variants.build do |new_variant|
new_variant.supplier_id = producer_options.first.second if producer_options.one?
new_variant.tax_category_id = product.variants.first.tax_category_id
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth adding a check to see if variant exists? Ive noted in UI that a minimum of one variant always exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Code review 🔎
Development

Successfully merging this pull request may close these issues.

New variant tax category should be the parent product tax category by default
1 participant