Jump to content

Accessories visible on product page when out of stock -HACK- 1.5.2


xmurph

Recommended Posts

Hello Prestashop:-)

I see that on 1.5.2 version of Prestashop, when a product becames out of stock (quantity 0), if this product is an accessory for another product it disappears from that product accessories tab. I think this is not a bug of Prestashop developement guys, but a choice. personally I do not agree with this choice, is useful to show accessories to our customers, our shop image is very relevant, also is useful for search engine that can access from our product page also on accessories pages even if these are unavailable.

So, I lost 1 hour to make this hack and I hope Prestashop Team will agree with me and include in next releases...

 

btw here's my hack:

1 edit YourTemplateFolder/product.tpl

 

2 around line 555 find:

 

{if ($accessory.allow_oosp || $accessory.quantity > 0) AND $accessory.available_for_order AND

replace with this:

{if $accessory.available_for_order AND

 

3 after line 571 (after </p>) insert:

{if $accessory.quantity > 0}

 

4 after line 574 (find code beginning with: <a class="exclusive button ajax_add_to_cart_button" href=")

before </p> insert the following code:

 

{else}
  <span class="exclusive"><span></span>{l s='Add to cart'}</span><br />
 {/if}

 

DONE. Now your Prestashop 1.5.2 will show accessories of your products even if these are out of stock, the cart will be not shown...

  • Like 1
Link to comment
Share on other sites

Why would you want to still show it if its out of stock?

 

Because is important to show to the visitor that you have that accessory...is like to say: yes I have it, it' s out of stock, ok, but I have it...come back later on my shop maybe that accessory will be back in stock....

Marketing. In my own opinion is important to show a item even when it is out of stock:-)

Link to comment
Share on other sites

  • 1 month 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...