News:

Looking for documentation? Take a look on our wiki

Main Menu

rules price_quantity bug [VM4.0.7]

Started by hazael, October 19, 2022, 12:32:01 PM

Previous topic - Next topic

hazael

The product has a min_order_level set: 2
If I use directly in the product of the rules: price_quantity_start and price_quantity_end some prices are not displayed as per the rule.



Example 1

My price rules for quantity range:






no | price_quantity_start | price_quantity_end | discount
A010
B22-10%
C33-20%


In the product list is displaying the base price with tax for 1 pc. Here is the rule A - everything is ok. The price is displayed without promotion. But...
Directly in the product: Rule B should run for the start - this rule works, but not entirely. I have a set price for 2 pc with discount -10%, but these prices (the amount of the discount) aren't showing up:

  • variantModification
  • salesPriceWithDiscount
  • discountAmountTt

If I choose rule C -3 pieces and so on, these above prices are still not showing up... These values ​​are '0'.



Example 2






no | price_quantity_start | price_quantity_end | discount
A010
B12-10%
C33-20%

In this case, variant A is ignored and variant B is displayed - it is logical. Prices variantModification, salesPriceWithDiscount, discountAmountTt, are displayed everywhere.


----------------------------------
VirtueMart 4.0.7 10720

hazael

OK... I understand that no one is talking about it because "it works well for everyone"   :(

Milbo

you have min order 2, but your prices start for one product. This is not logical. This is the first I am stumble over, Then you show a table that seems to work, so just learn how it is used. It is the old topic in school, "Is the border part of the set?" So just use it as intended and it works.

The code is

if(empty($price['price_quantity_end']) and $price['price_quantity_start'] <= $quantity){
$quantityFits = true;
} else if ($price['price_quantity_start'] <= $quantity and $quantity <= $price['price_quantity_end']) {
$quantityFits = true;
} else {
$quantityFits = false;
}


You may "fix" it, or may make it better from your viewpoint, but it wont work for others, then. So according to the code, just do not doubled numbers

Not 1-2,2-4,4-10,10-
instead use
1-2,3-4,5-10,11-

and then anything works. That is something, which people just test out, takes 5 minutes. and that is also the reason that no one answers here. No one is paid to answer you and either people know that it works and that they did it somehow, then they do not answer, because they see the first illogical thing min product 2, but you have a price for 1. Other people who never worked with it, dont know what they should write here.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

hazael

#3
I know that this is a very non-standard activity and that's why I guess not everyone may be interested in it



The problem is something else.
In the list of products, I am showing the price for 1 pc without discount. But on the product page, the minimum order quantity is 2 pieces without discount. If you set a discount from 3 pc or more, these variables (variantModification
salesPriceWithDiscount, discountAmountTt) will always be 0.
This is probably a problem with the Javascript function, which at the beginning of the cart see the value 0. Each additional quantity added to the cart will not change this value.
This problem appears in the example of the first table

I know it is not logical. But the client wants it this way :) He wants the price for one piece, but he sells at least 2. This is how marketing works.
In the list of products, if you see the price per item and preferably the net price, you get the impression that it is very cheap
But unfortunately, you have to buy more than one piece. Such manipulation ;-)

A perfect example of this is the sale of very expensive audiophile loudspeakers. You have a price per piece, but you need to buy a pair.

In my case, there is a sale of a building in a terraced. There is a price for the house, but you need to buy a minimum of 2 buildings. There is an additional discount for each subsequent building in a terraced :)
My solution that immediately counts the dimensions of a building plot for each additional building added to the cart :)
https://szeregowe.pl/pawel-i-gawel-1a

Darko F.

There in no problem if you fall. Problem is if you don't get up