Jump to content

Minimum weight per order


Recommended Posts

Hi, could somebody please advice me if there is a way to set a minimum weight for an order? It would be best if it displays in the cart and doesn't allow checkout if the limit not met? I noticed there is an option for a minimum price, but I need the weight instead. Is there any easy way please?

 

Any advice very much appreciated  :)

 

Jana

Link to comment
Share on other sites

There is no way to do this from the backoffice -- you would need to alter the code and program this in yourself or hire someone to do it for you. I'm only starting with Prestashop so I have no idea how complex or easy this would be. I'm leaning toward it likely being fairly simple.

 

You don't mention why you need a minimum weight. If the problem is that you are selling small objects and it is causing issues with your shipping module rounding down to zero weight that could be solved by having the packaging weight sufficiently to ensure the package is at least over the minimum for the shipping module to work properly. 

Link to comment
Share on other sites

Are the products sold by weight? Is the 100kg minimum per product or 100kg combined over multiple products?

 

If for example the customer is selling gravel at $2/kg with a 100kg minimum then that can easily be done just by using the minimum quantity to 100. That would allow people to buy any amount of gravel as long as it is more then 100kg.

 

If the goal is total weight across multiple products (50kg of fine gravel and 50kg of course gravel) or if the products are not sold in units that are proxies for weight then you need to customize PrestaShop to get the feature you want.

 

One last possibility would be to use price as a proxy for weight -- if there was a rough relationship between price and weight you might be able to set a minimum price value that would restrict orders to over 100kg. It wouldn't be perfect and how much error there would be would depend on the range of price/weight for products.

Edited by Naldinho (see edit history)
Link to comment
Share on other sites

In that case your only solution would be to customize PrestaShop. I don't think it would be difficult. The total weight is stored in some variable since it is used for shipping calculations and there is already a procedure for preventing orders less than a certain dollar amount. If you edit the code to replace the dollar amount variable with the total weight variable that should do it.Unfortunately that is as much help as I can offer as I haven't had time to dig into PrestaShop's internals yet. Hopefully someone with more experience will come along and give you the file names, line numbers, and variable names that you need to edit.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...