Step by step
E.g. lets set 10% discount for minimum 5 quantity and 20% for minimum 10 quantity.
Note: If product has a sale price the discount will be applied independently.
Now when user chooses appropriate quantities the discount applies in the cart. In our example 10% discount is set if no more 10 items so it can be seen in the first position. Second position isn’t touched because there is no entered discount for that product.
Finally, the discount is shown in the checkout page so a user can ensure his discount.
Some settings can be applied.
- Undiscounted price visibility
For some reasons undiscounted price view may be turned off so it won’t be visible in cart and checkout pages.
- Calculation mode
If there is need to choose appropriate discount according to position in the product settings list, the calculation algorithm should be set to ‘First match’. ‘Best discount’ is a default option and it chooses the best discount from the product discount list.
Currently there is only one function. It can be used in site’s theme or in other plugin.
seraph_wd\API::AdjustPrice( $product, $price, $attrs )
It adjust $price according to specified product $product and attributes $attrs.
E.g. seraph_wd\API::AdjustPrice( $product, 50, array( ‘quantity’ => 10 ) ).
- WooCommerce 3.2 or higher.
- WordPress 4.9 or higher.
- PHP 5.4 or higher.
- Browser (Google Chrome, Firefox, IE).