Jump to content

Want to emulate "New" red banner in product list; create one for out of stock items


Recommended Posts

Hello -

 

I am trying to recreate the red "New" banner that is applied to new products and use it to mark items "off menu". I am running a food delivery service and our weekly menu is smaller than the overall menu we offer for catering and special orders. I don't want customers to have to click through to the product detail page to find out if the product is available for regular order or not; it would be easier if they could just see from the product list.

 

I copied the span.new format in the theme/css/product_list.css and just changed the color:

 

#product_list li span.offmenu {

display: block;

position: absolute;

top: 15px;

right:-30px;

padding: 1px 4px;

width: 101px;

font-size:10px;

color: #fff;

text-align: center;

text-transform: uppercase;

-moz-transform: rotate(45deg);

-webkit-transform: rotate(45deg);

background-color: #000099

}

 

and then tried to insert the right code into product_list.tpl

{if isset($product. available_for_order) && $product.quantity == 0)}<span class="offmenu">{l s='off menu'}</span>{/if}

 

after the code for the previous code for the span class ="new".

 

When I refresh the product list page disappears suggesting I have the wrong code or I haven't inserted it correctly.

 

Any guidance on what I am doing wrong would be much appreciated. If there is an easier way to get the same result (know from product list which products are in stock/out of stock) that would be great as well.

 

Thanks in advance.

Link to comment
Share on other sites

  • 3 months 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...