Jump to content
  • 0

Changing bgcolor of "Out of Stock" Symbol?


flordetabaco
 Share

Question

2 answers to this question

Recommended Posts

  • 0

The orange background? That's quite simple!

 

If you want to change that label (it's the default warning label used throughout PrestaShop) for all it's instances, go into /<your theme>/css/global.css and find .label-warning, it should look like this in the default theme:

.label-warning {
  background-color: #fe9126;
  border: 1px solid #e4752b; }
  .label-warning[href]:hover, .label-warning[href]:focus {
    background-color: #f07701; }

Simply change the background-color and border properties to colours you like better.

 

If, however, you specifically want to target this message, go into /<your theme>/product.tpl, and find the <span> with id availability_value. In the default theme, it looks like this:

<span id="availability_value" class="label{if $product->quantity <= 0 && !$allow_oosp} label-danger{elseif $product->quantity <= 0} label-warning{else} label-success{/if}">{if $product->quantity <= 0}{if $PS_STOCK_MANAGEMENT && $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{elseif $PS_STOCK_MANAGEMENT}{$product->available_now}{/if}</span>

Then, add the following inline CSS: style="background-color: <some color>; border: 1px solid <some color>;", like so:

<span id="availability_value" style="background-color: #090; border: 1px solid #ccc;" class="label{if $product->quantity <= 0 && !$allow_oosp} label-danger{elseif $product->quantity <= 0} label-warning{else} label-success{/if}">{if $product->quantity <= 0}{if $PS_STOCK_MANAGEMENT && $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{elseif $PS_STOCK_MANAGEMENT}{$product->available_now}{/if}</span>

Good luck and let me know if you need any help!

Edited by Apium (see edit history)

Share this post


Link to post
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More