#Intro

WooCommerce Min Max Quantity & Step Control v 1.0

WooCommerce Min Max Quantity & Step Control plugin offers to control of all products or specific products with minimum , maximum and step of quantity. With this plugin you will be able to set your product quantity as much as you want.

Created:11/30/2018

Last Update:12/12/2018

Author name:Saiful Islam

Author user:Codeastrology

Email:codeastrology@gmail.com

Thank you for purchasing my plugin. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here or you can contact with plugin Support page WooCommerce Min Max Quantity & Step Control Support. Thank you so much.

#Installation

Note: Woocommerce Min Max and Step Control Plugin is depended on WooCommerce Plugin
As a WooCommerce Add-ons plugin, first you have to confirm that, WooCommerce is already installed in your site. Also confirm that you have few Products available in your store. See How to install WooCommerce. And add products to your store. After evreything is setup properly, install WooCommerce Min Max Quantity & Step Control plugin.

To install, Please follow the steps bellow:

Step 1: First extract your zip file, what you have downloaded from Codecanyon. And enter into extracted folder. up to -> inside [Main Files] folder. Choose right plugin file like following screenshot

Step 2: In your WordPress Admin Panel, go to Plugins > Add New

Step 3: Click on the Upload Plugin button

Step 4: Select the WC_Min_Max_Quantity_V1.0_12.12.2018.zip' file

Step 5: Activate the newly installed Plugin

Great !!! Successfully Installed .

#Getting Start

Note: Woocommerce Min Max and Step Control Plugin is depended on WooCommerce Plugin
As a WooCommerce Add-ons plugin, first you have to confirm that, WooCommerce is installed in your site. Also confirm that you have few Products available in your Store. See How to install WooCommerce. And add products to your Store.

WooCommerce Min Max & Step Control settings page

If you properly install WooCommerce Min Max Quantity & Step Control then this plugin will work properly. For the settings page go to (Dashboard > WooCommerce > Min Max Step Quantity). See following screenshot:

WooCommerce Min Max Quantity & Step Control in Dashboard.

Setting (Universal): This page's setting value is global or universal. That means: this setting's value will impact to all products - by default. But if you want to set different value for any specific product, then you are able to do that from product edit page. To see details: Go to here

Messages: message for validaton check of minimum,maximum quantity and step value. You are able to change these message text. Important Note: Don't change [%s], because it will work as like variable. In this plugin 1st [%s] will return Quantity(min/max) and second [%s] will return product's name.

Setting for single product.

Normally we will get min,max,step value from Setting (Universal):. When we need different value for a single/any product, only then we will use this setting. see following screenshot.[Product Edit -> product data(tab) -> Min Max & Step panel]. Remember: It will override the settingg will be same from universal only for this product. Other product setting will remain as the universal settings

#Plugin Features

WooCommerce Min Max Quantity & Step Control

With this awesome plugin you can define quantity of your products and also can set indivusal quantity of every different single product.

Quantity Steps For Single Product:

If you set an individual quantity for a single product then the Quantity Steps For Single Product will override the global value for quantity steps.

Filter max/min number of product (Global):

When you select, Minimum Quantity of product in the Dashboard of plugins setting, all products minimum quantity will be taken from that given value.

Similarly select the Maximum Quantity of products to be added to cart from plugin settings.

Filter Max/Min number of product (Single Product):

You can change the default value of Min/Max number of product for any product you want. Just head over to product page and set the value for the individual product.

Filter Max/Min number of product (Single Product):

You can change the default value of Min/Max number of product for any product you want. Just head over to product page and set the value for the individual product.

User friendly:

Worry to operate this plugin?. It’s UI very easy to operate.

All Themes supported:

We’ve checked this plugin with a variety of themes and confident that it will also work with your theme.

All Messages are customizable:

You can change all the custom messages of this awesome plugin .

Working on the cart page:

Quantity validation will also work on the cart page while update the product on cart..

Woo Product Table Pro compatible:

WooCommerce Min Max Quantity and Step Control is compatible with Codecanyons bestselling Product Table plugin Woo Product Table Pro.

Compatible with “Woo Product Table” plugin:

With WooCommerce Min Max Step Quantity you can set the quantity steps in Woo Product Table Pro as well as in other WooCommerce plugin. By setting steps products quantity will increase or decrease according to the given number.

#Screenshots

Profuct table screenshots

live demo

These screenshots show some of the different uses of our WooCommerce Min Max Quantity and Step Controll

Some Warning while trying to add to cart more than maximum products.

Setting Page

Result of set up in , max and step

Quantity validation on cart page

Showing Title with minimum product on the single shop page

Compatible With Woo Product Table Pro

#FAQ

Does it work with all themes?

Ans:Yes, It works.

Can I set default quantity for all products?

Ans:Yes. You can set. For this click on the Woocommerce > Min Max Step Quantity . Then you will have options to set min,max and step number for all products.

Is it possible to define different quantity for a specific product ?

Ans:Yes,For this you have to define this while adding new product or editing an existing product. There will be option inside product data . The tab name is : Min Max & Step. From here you can set for indiviusal product.Cheers !

From where can I configure different quantity for a specific product?

Ans:To configure settings for single product head over to your single product page which you want to edit. For instance, If you want to configure settings for a existing product named Pizza, navigate to the product page (Dashboard->Products>All Products->Pizza->Product Data->Min Max & Step). From there you can configure different quantity for a specific product.

From where can I configure default quantity for all products?

Ans:Navigate to Dashboard->WooCommerce->Min Max Step Quantity and from here you can configure the global settings. Also you can configure it from Plugins->Installed Plugins->WooCommerce Min Max Quantity & Step Control->Settings.

#files structure

WC_Min_Max_Quantity
  • admin
    • add_options_admin.php
    • plugin_setting_link.php
    • product_panel.php
    • set_menu_and_fac.php
    • wcmmq_style.css
  • includes
    • set_max_min_quantity.php
  • wcmmq.php
  • readme.txt

#Code structure

PHP Structure

<?php

function wcmmq_update_cart_validation( $true, $cart_item_key, $values, $quantity ) { 
    $product_id = $values['product_id'];
    
    $min_quantity = get_post_meta($product_id, '_wcmmq_min_quantity', true);
    $max_quantity = get_post_meta($product_id, '_wcmmq_max_quantity', true);
    //var_dump($max_quantity);exit;
    $min_quantity = !empty( $min_quantity ) ? $min_quantity : WC_MMQ::getOption( '_wcmmq_min_quantity' );
    $max_quantity = !empty( $max_quantity ) ? $max_quantity : WC_MMQ::getOption( '_wcmmq_max_quantity' );
    
     //wc_add_notice( __( "QT " . $min_quantity, 'wcmmq' ), 'notice' );
    
    if( $quantity <= $max_quantity && $quantity >= $min_quantity ){
        return true;
    }elseif( $quantity > $max_quantity ){
        wc_add_notice( __( "Maximum quantity should " . $max_quantity . ' of ' . get_the_title( $product_id ), 'wcmmq' ), 'error' );
        return;
    }elseif( $quantity < $min_quantity ){
        wc_add_notice( __( "Minimum quantity should " . $min_quantity . ' of ' . get_the_title( $product_id ) , 'wcmmq' ), 'error' );
        return;
    }else{
        return true;
    }
}; 
                                    

CSS Structure

We have used CSS, Only for BackEnd form of our plugin.

/******** Style for Min Max & Step Controll plugin's Setting page'*******************/
span.configure_section_title {
    font-size: 18px;
    width: 102%;
    background: #4CAF50;
    color: #f3f3f3;
    padding: 5px;
    line-height: 18px;
    text-transform: uppercase;
    font-weight: normal;
    padding-right: 0px;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
    display: block !important;
}
.wcmmq_config_form th {
    width: 300px;
    padding: 15px;
    text-align: left;
}
.wcmmq_config_form_message tr td>input{width: 350px;}
.wcmmq_white_board {
    display: block;
    background: #ffffff;
    padding: 0;
    overflow: hidden;
}
                                    

#credits

jQuery

jquery.com

Only for Documntation.

Bootstrap v4.1

getbootstrap.com

Only for Documntation.

Google code prettifier

github.com/google/code-prettify

Only for Documntation.

#Changelog

v1.0 (11/29/2018)

  • Initial release

Once again, thank you so much for purchasing WooCommerce Min Max Quantity & Step Control . As I said at the beginning, I'd be glad to help you if you have any questions relating to this plugin. No guarantees, but I'll do my best to assist. If you have a more general question related to the plugin on Codecanyon, Feel free to knock at our email: codeastrology@gmail.com or you might consider visiting the forums and asking your question in the "Item Support" section.

Saiful Islam