• Resolved publicstaticjg

    (@publicstaticjg)


    Hello.

    I use width x length calculation as a part of final price. There is an option which allows to set minimal amount for numeric input field and it works ok. But I want to allow customers to order product with any size but price can’t be less than 5000.

    100×200 – 10000
    100×100 = 5000
    70×90 = 5000

    Is it possible to do in some version of your plugin? (Maybe PRO?)

    Best Regards,
    Mihail

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Altos

    (@sefin)

    Hello
    Yes, I think you can do it:
    For free version you will need to use some coding in PHP in your functions.php file. This is an example:

    function filter_custom_wpc_add_to_cart_validation($bool, $product_id, $quantity){
    	if($product_id == 40){
    		$width		= $_REQUEST['aws_price_calc_1'];
    		$height		= $_REQUEST['aws_price_calc_2'];
    		
    		if(($width+$height) >= 2000){
    			wc_add_notice("Width and Height are greater then 2000 mm", "error");
    			
    			return false;
    		}
    	}
    	
    	return true;
    }
    add_filter('woocommerce_add_to_cart_validation', 'filter_custom_wpc_add_to_cart_validation', 20, 3);

    So you can use the filter “woocommerce_add_to_cart_validation” to do that.

    if you need more than this try to ask at our forum.

    I hope this helps you.
    Let us know if you solved with this.

    Thread Starter publicstaticjg

    (@publicstaticjg)

    I mean if you need to buy a mirror that will be 100x100cm it will cost you 5000. But if you need to buy smaller one, let’s say 50x50cm, it will be anyway 5000 because of minimal price.

    Plugin Author Altos

    (@sefin)

    ah okay, I got it now. It’s possible.
    You can find more details on forum.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Minimal Price’ is closed to new replies.