Jump to content

Show the quanties in multiple of 250


Recommended Posts

Not possible with native resources. If you are a coder you can code this by overriding of the product rules. There are several files you need to make changes. If you are not a coder you can use a paid solution: https://addons.prestashop.com/en/cross-selling-product-bundles/19489-order-multiple-by-product.html

There is no free solution available that I know for this.

Link to comment
Share on other sites

I wasn't able to find a module that allowed for fixed quantities. I looked over a year ago so that may have changed. I just looked at the link provided by above -- not sure it does what I wanted but if it does I'd always suggest a proper module over trying to edit the core files yourself.


Anyway, when I needed this an option did not exist so I did some hacking -- it is actually a pretty simple if not very elegant solution.

First, you edit both the product page and the checkout page to remove the quantity from displaying. This is just a matter of deleting or commenting a few lines. 

 

Second, create an attribute called Quantity and treat the quantity as any other attribute. 

Done. In reality, the customer is buying a quantity of 1 with an attribute quality of X but since the 1 can't be changed and isn't displayed to them it looks like the attribute quantity is the only quantity. 

I only did this as a proof of concept. For other reasons that store has been delayed almost two years so I've never used this solution in a real customer-facing store. It is likely that quantity will show up in other places -- order history, e-mails etc so you'd need to find all those instances and also delete/comment out the code. The idea is to hard code a quantity of 1 and then make it so PrestaShop never displays that value on anything the customer sees.

An even less elegant solution that I have seen others use is to use the attribute feature to create quantity but then keep the actual quantity also. That creates the situation where people are buying 1 of 250 or 1 of 500. I really don't like this because it looks unprofessional and worse it is only a matter of time before someone orders 3 of 250 rather than 1 of 750 and that just adds confusion.

Link to comment
Share on other sites

What I did as for my solution: I added the product as a pack of X, so if my pack is 250 pcs. the next one is 500, if the customer adds 2 of them in the cart (750 when he choose 3). The only problem is when you use stock management you need to maintain the product as well as pack of 250 min.

Link to comment
Share on other sites

@eleazar - The minimum quantity feature is now available in prestashop feature itself so buying a new module is not a worth. Only thing I required multiply quantites with '2' and change price according to I set. Can I add hooks for doing that? will it work?

Link to comment
Share on other sites

@Naldinho what will happen when i upgrade the prestashop this code will get affected  right?

 

Correct. Any time you make changes to core files directly upgrading PrestaShop destroys those changes and you have to make them again. This is a pain which is why if you can avoid it then you should. 

 

What I do is keep a copy of the original file and my modification. When I upgrade I then use a program that shows the differences between the modified file and original and then just make those same changes to the new files after the upgrade again ensuring that I save a copy of the original and modified post-upgrade files for the next time.

 

When I'm lazy and don't document changes well what I do then is download the entire pre-upgrade site as well as a copy of PrestaShop with the exact same version then use something like Beyond Compare to just find all the files that were edited and use that to make edits to the new files post-upgrade.

 

It adds about an hour to an upgrade but realistically I don't want the site asking customers for birthdays, I don't want product condition showing, I want longer descriptions so that requires changing where they get truncated, I have a module that requires edited files, I want full TinyMCE etc.. Once you have to have a system in place for one edited file having more isn't that big of a deal.

Link to comment
Share on other sites

If i increase the quantity value it should reflect with the price also that i set for the particular thing like (250-499 quantities = $0.85, 500 above - $0.89)

 

This sounds like something different than your original question. Your original question as I understood it was that you wanted to sell products in a way so that people could only buy 250, 500, 750, 1000 etc  People would not be allowed to buy say 300. The inclusion of a range like 250-499 now implies something different. 

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...