Minimum total order

  • Posts: 6
  • Thank you received: 0
11 years 6 months ago #106176

Hi there

Because of packaging constraints, we only allow our online customers to buy a minimum of 6 of our products, and in multiples thereof.

This can be a mix of six different or 12 different wines though so the "min order amount" per wine doesn't apply.

Is it possible for Hikashop to do a validation check on the number of units they have before they are allowed to buy and pop up an error message if they have an incorrect number?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
11 years 5 months ago #106266

Hi,

You should just add a check on the file 'cart' of the 'checkout' view via the menu Display->Views and add such code:

<?php
$total = 0;
foreach($this->products as $product){ $total+=$product->cart_product_quantity; }
if($total%6){
 $app =& JFactory::getApplication();
 $app->enqueueMessage('Not possible');
 $this->nextButton = false;
}

Or you can also do it with manual shipping methods. Suppose that all your products weight 1kg. You could create shipping methods with range restrictions from 5.5 to 6.5, from 11.5 to 12.5, etc. And the system wouldn't find any shipping method when the weight wouldn't be in these ranges and wouldn't let the user finish the order.

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0
6 years 9 months ago #286985

Hello , I am not able to find above file please share full path of file and tell me where to add this code

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
6 years 9 months ago #286986

Hi,

It is components/com_hikashop/views/checkout/tmpl/cart.php
Please note that it can only work with the "checkout legacy" setting activated in the HikaShop configuration.

Please Log in or Create an account to join the conversation.

Time to create page: 0.073 seconds
Powered by Kunena Forum