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

[Core] Taxable variant #3915

Merged
merged 3 commits into from
Feb 9, 2016
Merged

Conversation

Zales0123
Copy link
Member

Q A
Bug fix? no
New feature? yes
BC breaks? yes
Deprecations? no
Fixed tickets #3829
License MIT
Doc PR

To improve taxes management and make it more flexible, relation to TaxCategory has been moved from Product to ProductVariant.

@Zales0123 Zales0123 changed the title Taxable variant [Core] Taxable variant Jan 19, 2016
@michalmarcinkowski michalmarcinkowski added this to the v0.17.0 milestone Jan 22, 2016
@Zales0123 Zales0123 force-pushed the taxable-variant branch 2 times, most recently from 726d038 to 1b8f5d0 Compare February 3, 2016 14:19
@@ -71,7 +71,7 @@ public function apply(OrderInterface $order, ZoneInterface $zone)
continue;
}

$taxRate = $this->taxRateResolver->resolve($item->getProduct(), ['zone' => $zone]);
$taxRate = $this->taxRateResolver->resolve($item->getProduct()->getMasterVariant(), ['zone' => $zone]);
Copy link
Contributor

Choose a reason for hiding this comment

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

That is wrong, we should use variant of this specific item $item->getVariant()

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@michalmarcinkowski
Copy link
Contributor

We should add Behat scenario for applying different tax rates on two variants of the same product.

@pjedrzejewski
Copy link
Member

@michalmarcinkowski 👍 - only problem I see that in new Behat contexts we currently handle only single variant products. I'd suggest waiting till #4053 is merged and then add this scenario here, so that new steps for selecting options, etc. follow new conventions.

@Zales0123 Zales0123 force-pushed the taxable-variant branch 4 times, most recently from 58ce9ee to cb80747 Compare February 8, 2016 12:15
And I am logged in as "john@example.com"

Scenario: Proper taxes for different taxed variants
When I add product "PHP Mug" to the cart, selecting "Medium Mug" variant
Copy link
Contributor

Choose a reason for hiding this comment

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

When I add "Medium Mug" variant of product "PHP Mug" to cart

@@ -63,6 +63,11 @@
</cascade>
</one-to-many>

<many-to-one field="taxCategory" target-entity="Sylius\Component\Taxation\Model\TaxCategoryInterface">
<join-column name="tax_category_id" referenced-column-name="id" nullable="true" on-delete="SET NULL" />
<gedmo:versioned />
Copy link
Member

Choose a reason for hiding this comment

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

Should we versioned this field? Some of fields has it, some doesn't.

Copy link
Member

Choose a reason for hiding this comment

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

I'd remove it for now as we do not handle these properly yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

pjedrzejewski pushed a commit that referenced this pull request Feb 9, 2016
@pjedrzejewski pjedrzejewski merged commit ad0f631 into Sylius:master Feb 9, 2016
@pjedrzejewski
Copy link
Member

Thanks Mateusz! 👍

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.

None yet

4 participants