Jump to content

Hide out of stock products


Recommended Posts

  • 1 month later...
  • 1 month later...
  • 2 weeks later...

Could you clarify this bit of code please.

 

try this add following line in your product-list.tpl file

 

after this line

{foreach from=$products item=product name=products}

add this

{if ($product.allow_oosp || $product.quantity > 0)}

// around line 31 and finish around line no 72

before this

{/foreach}

add this

{/if}

 

Am I right in thinking

 

After this line (which is around line 31)

{foreach from=$products item=product name=products}

add this

{if ($product.allow_oosp || $product.quantity > 0)}

 

Before this line (which is around line 72)

{/foreach}

add this

{/if}

 

The reason I ask is there is

//
in the piece of code and not sure is that is part of it.

 

Thanks,

 

Dahl

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

  • 2 weeks later...
  • 1 month later...
  • 1 month later...

Hello,

this solution works great , but, as carelessoul wrote, there is a major pagination issue , causing the count of the items-per-page to be screwed up as the out of stock items are still considered in the " $products " list sent to the template.

 

I.E. if a category has a lot of zero-quantity products, it could happen that the first page shows products, the second not and the third yes.

 

A fix would be really appreciated ! :) :)

Link to comment
Share on other sites

  • 1 month later...

Hello,

this solution works great , but, as carelessoul wrote, there is a major pagination issue , causing the count of the items-per-page to be screwed up as the out of stock items are still considered in the " $products " list sent to the template.

 

I.E. if a category has a lot of zero-quantity products, it could happen that the first page shows products, the second not and the third yes.

 

A fix would be really appreciated ! :) :)

 

gennolo , i have a idea about to solve this. i want to share , So that we can implement this to our upcoming theme.

There will be a a module which have a cron page and in that cron page it will check a option from module where people can enable or disable stock product.

 

there is two way one is from module they press diable all product which have out of stock or point the cron job which fire each day and disable the out of stock product.

 

which method you all like.

Link to comment
Share on other sites

×
×
  • Create New...