Jump to content

Apply discount only for items in stock


Recommended Posts

Hello, i am looking for a way to apply discounts / offers on products but only for the available quantities. If the store runs out of stock of a product, then any discount on this product i want to be disabled.

 

Is there such a functionality?

 

Regards,

C

Link to comment
Share on other sites

Hi

 

If there is no available quantity, then customers can't add the product to the cart (there is an option at the backoffice to disable that functionality - Preferences>Products>Allow ordering out-of-stock products>No). Therefore, discounts can't be applied although they are available.

 

But if you want to disable the "Volume Discounts"  tab of the product page if there is no available quantity, then it needs a code modification.

 

1. Open themes>yourtheme (default-bootstrap if you are using the default theme)>product.tpl

2. Find the below line

{if (isset($quantity_discounts) && count($quantity_discounts) > 0)}

3. Replace it with the below line

{if (isset($quantity_discounts) && count($quantity_discounts) > 0) && $product->quantity}

P.S. There shouldn't be any quantity of any combination. If there is a combination with available quantity, then the tab is displayed.

Link to comment
Share on other sites

  • 6 months later...

Found this Post, and thought it is almost similar to what I want my shop to do.

 

I would like the shop to automatically place a discount to a product if stock is 0.

 

So it is opposite, what I want :)

 

is this possible?

​I use default theme.

Link to comment
Share on other sites

  • 2 years later...

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