For Users

Installation

First way to install plugin:

  1. Download plugin from your BeRocket account
  2. Disable FREE version of the same plugin if you have it
  3. Open your site admin and select menu item Plugins -> Add New -> Upload Plugin
  4. Click Browse, select downloaded zip file and click Install Now
  5. When done click Activate Plugin

 

Second way to install plugin:  

  1. Download plugin from your BeRocket account
  2. Disable FREE version of the same plugin if you have it
  3. Open your site via FTP
  4. Find there WordPress folder/wp-content/plugins
  5. Extract folder from downloaded zip file
  6. Copy extracted folder to plugins folder
  7. Open your site admin and select menu item Plugins
  8. Find there WooCommerce Min and Max Quantities and click Activate under it

Setup

Limitations

Global limitations you can find in plugin settings Admin Panel -> BeRocket -> Min/Max Quantities

Specific limitation you can setup in Admin Panel -> BeRocket -> Min/Max Quantities -> Limitations Read more about options

Products limitation fields exist in general settings of every product and variation.

Account/Product Key

BeRocket Account and Product key are needed for auto update plugins from BeRocket site.

Where can you find Account Key?

  1. Open BeRocket site and login (login link can be found in header menu)
  2. Click My Account link in the header menu
  3. On the right side of the page you can find all information about your BeRocket account, including Account Key

  4. You can click on account key and copy it
  5. What can you do with Account Key?

Where can you find Product Key?

  1. Open BeRocket site and login (login link can be found in header menu)
  2. Click My Account link in the header menu
  3. Click key icon on the right side from plugin name WooCommerce Min/Max Quantity

  4. You can click on Product key and copy it
  5. You can use field on the left as a title
  6. Click DONE to save
  7. What can you do with Product Key?

Settings

WooCommerce Min/Max Quantity have settings in Admin Panel -> WooCommerce -> WooCommerce Min and Max Quantities

General

Contains general settings for Products Min/Max page and global limitations

  • Hide Checkout button - if min/max requirements no passed hide checkout button.
  • Cart products quantity - limitation by products count in cart
    • Minimum - minimum required products count
    • Maximum - Maximum products count limit
  • Cart products price - limitation by products cost in cart
    • Minimum - minimum required products price
    • Maximum - Maximum products price limit
  • Global multiplicity - Products in cart must be multiplicity by this value
  • Prevent add to cart - Do not add products to cart for some limitation(If multiple products can pass limitation, then products will be added)
  • Groups manager - limit products in group. Create group first and after select this group in products

CSS

Contains setting to set custom CSS code that will be placed on frontend pages.

  • Custom CSS - custom CSS code

License

Plugin key - uses for updates plugin from BeRocket site. You can get this on BeRocket site -> My Account page on click key icon

Min/Max Limitation

Limitation that will be used for products with specific attribute, category, price etc.

You can create limitation in Admin Panel -> BeRocket Posts -> Min/Max Limitation

Conditions

You can use multiple condition with different settings to select products that you need for this limitation.

Min/Max Limitation conditions

Conditions on image means that this limitation will be used for products from category Dress and color must be not yellow, also will be used for products from category Jeans.

Limitation will be used for all products that equal conditions.

Min/Max Settings

Limitation

  • Minimum Quantity - minimum required products count
  • Maximum Quantity - Maximum products count limit
  • Minimum Price - minimum required products price
  • Maximum Price - Maximum products price limit
  • Multiplicity - Products must be multiplicity by this value
  • Each Product - If this option enabled, then limitation will be used for each products instead of summary of products
  • Check limitation for - How limitation will be used to variable products
    • Products without variation and variations - condition and limitation will be used for variation
    • Products without variation and products with variations - condition and limitation will be used for product with variation instead of variation

Text

  • Use local text - Use messages from this limitation instead messages from global plugin settings
  • Minimum Quantity Message - Message for this limitation minimum quantity error
  • Maximum Quantity Message - Message for this limitation maximum quantity error
  • Minimum Price Message - Message for this limitation minimum price error
  • Maximum Price Message - Message for this limitation maximum price error
  • Multiplicity Message - Message for this limitation multiplicity error

BeRocket Account

BeRocket account settings are in Admin Panel -> Settings -> BeRocket Account.

Contains field for place BeRocket Account Key

Where can you find Account Key?

  1. Copy Account Key from BeRocket site
  2. Paste this key to Account key field
  3. Press Test button
  4. If you use right Account Key you will see

  5. Then press Save button

For Developers

Filter hooks

mm_quantity_get_template_part

Template that uses in plugin.

Parameters

  1. template - link to template that will be loaded.
  2. name - template name.

Usage

<?php
function change_mm_quantity_get_template_part ( $template, $name ) {
//your code here
    return $template;
}

add_filter( 'mm_quantity_get_template_part', 'change_mm_quantity_get_template_part', 10, 2 );
?>

Functions

includes/functions.php

br_get_woocommerce_version()

Public function to get WooCommerce version

return string. woocommerce version

woocommerce-minmax-quantity.php

All of these functions is in class BeRocket_MM_Quantity as static functions.

init ()

Function for initialize scripts.

register_mm_quantity_options ()

Function for initialize scripts and settings page in admin panel.

mm_quantity_options ()

Add option page to admin menu.

br_get_template_part( $name = '' )

Get template part (for templates like the slider).

  • $name - template name

Default templates places in plugins folder woocommerce-minmax-quantity/templates.

To rewrite the template in your theme folder create folder with name woocommerce-minmax-quantity and places new template with identical name in this folder.

Options

All settings you can find in BeRocket_MM_Quantity class in static variables $defaults.

public static $defaults = array(
        'cart_min_price'    => '',
        'cart_max_price'    => '',
        'cart_min_quantity' => '',
        'cart_max_quantity' => '',
        'groups'            => array(),
        'custom_css'        => '',
        'plugin_key'        => '',
    );

Files

  • woocommerce-minmax-quantity.php - main plugin file
  • css - folder with CSS files
    • admin.css - styles for admin panel
    • colpick.css - styles for color picker block
    • font-awesome.css - standard Font Awesome styles
    • shop.css - front end styles
  • fonts - Font Awesome fonts
  • includes - folder with additional PHP files
    • functions.php - public functions
    • updater.php - BeRocket Updater for plugins update from BeRocket site
  • js - folder with JavaScript files
    • admin.js - JavaScript for admin panel settings
    • colpick.js - JavaScript for color picker in admin panel settings
  • templates - templates for settings, list style and buttons
    • settings.php - plugin settings page