I have been trying to solve what I thought might be an easy fix but I can't seem to find any information anywhere.
My problem is this:
I am setting up a wholesale store using WooCommerce with the min/max quantity and wholesale store plugins. I want to show a simple product with its single unit price (no problem) but as all products in the store are wholesale they can only be sold in (multiples) cartons of 6 or 12.
The min/max plugin allows me to set a minimum order quantity (say 12 items) but when I click on the -/+ Minus and Plus quantity selector to add another carton (another 12 items) it only adds one number (single item) at a time... E.g. 13, 14, 15, 16 and so on.
So my question is... "Is it possible to modify the 'quantity.php' file so the order quantities only go up in increments of 12?" (E.g. 12, 24, 36, 48, etc.)
I know I could simply set up and show the single carton cost as a simple product or do variables but my client wants to show a per unit price.
Thanks in advance for any feedback you may have.
There's no need to change core, nor even to use WooCommerce's template override. As Rashid points out, there is a filter in place for modifying this value. We just need to use it. Put this in a site-specific plugin.
add_filter( 'woocommerce_quantity_input_step', 'kia_quantity_input_step', 10, 2 );
function kia_quantity_input_step( $step, $product ){
return 6; // the will be the new step value
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With