Jump to content

Product Delivery Date And Quantity Discount


Martijnsb

Recommended Posts

Dear all,

 

I have a question about the standard prestashop modules delivery date and quantity discount. I am using prestashop version 1.5.3.

First of all, on the check-out page where you can choose your carrier, you can see your estimated delivery date. Though it works, I do have a problem with it. When I have for example 5 pieces in stock from product X and I order 6 pieces, it gives me the minimum delivery date (for on stock products). But what I want in this case is to show the maximum delivery date (in my situation 3 days-5 days extra). That is all set in the back-office. But how can I make this work?

 

About the quantity discount. Now it is sorted this way for example: 30 pieces - 20 pieces - 10 pieces. What I want is a reversed sequence of this. 10 pieces - 20 pieces - 30 pieces etc. I did try a few thinks but those didn't work out well. Can somebody provide me with a code for it?

 

Thank you all in advance!

Link to comment
Share on other sites

Hi Martijn,

 

About the second question:

Open the file /classes/Specificprice.php:

 

Locate the function:

 

public static function getQuantityDiscounts($id_product, $id_shop, $id_currency, $id_country, $id_group,

$id_product_attribute = null, $all_combinations = false, $id_customer = 0)

 

There is an SQL database statement in this function that has an order part in it. Change this part:

 

ORDER BY `id_product_attribute` DESC, `from_quantity` DESC, `id_specific_price_rule` ASC, `score` DESC

 

Into:

 

ORDER BY `id_product_attribute` DESC, `from_quantity` ASC, `id_specific_price_rule` ASC, `score` DESC

 

That does the trick.

 

Actually, you should override this class file, instead of directly edit the original, to simplify upgrading to newer PS versions. See the Prestashop developers documentation about overriding class files. See link here for details:

http://docs.prestash...verridingaclass

 

Hope this helps,

Pascal

Edited by PascalVG (see edit history)
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...