VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Geppux on January 26, 2016, 12:42:00 PM

Title: Child price change changing category
Post by: Geppux on January 26, 2016, 12:42:00 PM
VM 3.0.12 - J 3.4.8

Hi I try to explain what happens ...
The price structure of my products is made in this way:  I have some dummy categories for taxes or discount so to fix a price I insert the cost price and it changes depending on the categories of the product.
When I have child, I insert the parent price as usual, I just insert a different cost price in the child products list of the parent only if the price of a children is different and I don't give categories to the child, and everything goes smoothly, the child inherits the parent price and taxes and calculation rules.....but...if I assign a category to a child it don't inherits the rules and taxes so the price shown is the cost price and to obtain the correct price I have to insert the child in the same dummy categories of the parent. Is it normal, is it a bug, I'm missing something?
Thank you.
Giuseppe
Title: Re: Child price change changing category
Post by: lindapowers on January 29, 2016, 17:32:23 PM
Not sure if this is the same issue we have.

If childs have no category they don't inherit the tax rule of the parent so what we do each time we have to change the price of a child is first assign it to the category where the parent belongs, then click "calculate base price" since we enter the price directly in the final sale price.

That way it takes the tax from the parent to calculate the price.

Is very strange what you comment cause in my case the child does inherit the rules of the parent when they have a category assigned but not when they have no category but we don't use those dummy categories you mention, instead our tax rules are assigned per category.

Regards
Title: Re: Child price change changing category
Post by: Geppux on January 29, 2016, 18:38:38 PM
Well, I call them dummy categories just because exist but are unpublished but they are normal categories like yours, the strange it that my products behave in the opposite way than yours...
Title: Re: Child price change changing category
Post by: Milbo on February 04, 2016, 23:18:35 PM
Quote from: Geppux on January 26, 2016, 12:42:00 PM
VM 3.0.12 - J 3.4.8

Hi I try to explain what happens ...
The price structure of my products is made in this way:  I have some dummy categories for taxes or discount so to fix a price I insert the cost price and it changes depending on the categories of the product.
http://docs.virtuemart.net/manual/general-concepts/207-categories.html
We call them almost the same "CONTROL CATEGORIES (DUMMY CATEGORIES)"

Quote from: Geppux on January 26, 2016, 12:42:00 PM
When I have child, I insert the parent price as usual, I just insert a different cost price in the child products list of the parent only if the price of a children is different and I don't give categories to the child, and everything goes smoothly, the child inherits the parent price and taxes and calculation rules
nice, niice :-) I think that is the first time that I read in the forum, that someone uses the full potential of product derivation and control categories to create prices.

Quote from: Geppux on January 26, 2016, 12:42:00 PM
.....but...if I assign a category to a child it don't inherits the rules and taxes so the price shown is the cost price and to obtain the correct price I have to insert the child in the same dummy categories of the parent. Is it normal, is it a bug, I'm missing something?
Thank you.
Giuseppe
This is exactly the way it is intended. It is even more complex. The categories are not inherited for browsing your products. Only products with a visible category are browseable within the store. The reason is that the sql searches for products which has an xref table entry to a certain category.

But a displayed product (also in the category browse page) is always inheriting the categories of the parent as long there is no category set.

So when you set 1 category, you override any category of the parent. Else we would have to merge the category arrays and it would not be possible to remove a category from a child. So either you set nothing, or you set any.

And to underline, there is the convention:
Categories are entered =>browseable in store
This "defines" also the diffference if you present a product as a variant or on its own


Quote from: lindapowers on January 29, 2016, 17:32:23 PM
Not sure if this is the same issue we have.

If childs have no category they don't inherit the tax rule of the parent
This is wrong. Your misunderstanding is, that you enter the final price and you want to have calculated the baseprice, which does not work with the inherited categories. Yes

Interesting problem btw, we may change this, by adding inherited categories for recalculation
Title: Re: Child price change changing category
Post by: Geppux on February 04, 2016, 23:31:56 PM
Thank you Milbo for the explanation, now it's clear.

Giuseppe
Title: Re: Child price change changing category
Post by: lindapowers on February 05, 2016, 14:59:54 PM
This dummy categories thing is interesting, Im gonna read and check carefully, when we set childs at the first stage was quite a recent addon and there was no documentation back then so I guess is time to read and learn more about the use, thanks.
Title: Re: Child price change changing category
Post by: Milbo on February 07, 2016, 15:05:40 PM
dummy categories are part of the calculation rules system since very long time. For more than 4 years.

http://forum.virtuemart.net/index.php?topic=98642.0