How to set maximum purchase value in VirtueMart?

The VirtueMart script allows you to set the minimum sum per a purchase. This can be done from the Joomla Administrator Area->Components->VirtueMart->Store->Edit Store.

The field in the question is called Minimum purchase order value for your store.

With some code modifications you can change the corresponding functionality to check the maximum purchase order value.

In order to complete the modification open the administrator/components/com_virtuemart/html/basket.php file and change the following code:

/* check if the minimum purchase order value has already been reached */
    if( !defined( '_MIN_POV_REACHED' )) {
        if (round($_SESSION['minimum_pov'], 2) > 0.00) {
            if ($total_undiscounted >= $GLOBALS['CURRENCY']->convert( $_SESSION['minimum_pov'] )) {
                // OKAY!
                define ('_MIN_POV_REACHED', '1');
            }

to

/* check if the max purchase order value has already been reached */
    if( !defined( '_MIN_POV_REACHED' )) {
        if (round($_SESSION['minimum_pov'], 2) > 0.00) {
            if ($total_undiscounted <= $GLOBALS['CURRENCY']->convert( $_SESSION['minimum_pov'] )) {
                // OKAY!
                define ('_MIN_POV_REACHED', '1');
            }

You can also change the following messages in theadministrator/components/com_virtuemart/languages/common/english.php file:

'PHPSHOP_CHECKOUT_ERR_MIN_POV' => 'Minimum purchase order value has not been reached yet.',
'PHPSHOP_CHECKOUT_ERR_MIN_POV2' => 'Our minimum purchase order value is:',
'PHPSHOP_STORE_FORM_MPOV' => 'Minimum purchase order value for your store',

You need help with a shopping cart? hostlantern is specialized in eCommerce hosting and provides expert support for a large number of shopping carts. Check out our shopping cart hosting services!

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to remove recently viewed products from the homepage in VirtueMart?

You can disable the visualization of the recently viewed products from your web site's front end...

How to hide the Add to Cart button for non-registered users in VirtueMart?

In order to hide the Add to Cart button for non-registered users edit...

How to install a language pack in VirtueMart?

First you should install the chosen language pack for Joomla. You can find detailed instructions...

How to change the ”Recommend to a friend” message in VirtueMart?

The Recommend to a friend link in the products details pages can be enabled from the Joomla...

How to change the border color of the checkout order comment box in VirtueMart?

In order to change the border color of the text box, where you can enter your customer notes...