Support » Plugin: Show Stock Status for WooCommerce » Customization: color and out of stock

  • Resolved prohapro

    (@prohapro)


    Thanks for a good plugin. I had a little problem with “Only 1.000000e+0ft in stock!” But after I use “%s” instead “%” in main.php, it works fine.
    What is the easiest way to customize?:
    1. Color of printf “%s left in stock”
    2. “Out of stock” label (with backorders checking if possible)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter prohapro

    (@prohapro)

    “Out of stock” label solution for non-variable (editing main.php v0.2.4), works well!

    16 $low_stock_notify = 1;
    24 return ‘<div class=”remaining”>’.printf(_(‘Out of stock’),number_format($product->get_stock_quantity(),0,”,”)).'</div>’;
    17-22, 29-45 //Disabled

    How to add backorders check (IF stock quantity = 0 AND backorders = no THEN return “Out of stock”; IF stock quantity = 0 AND backorders = yes THEN return “Backorders”)?
    How to change color of output text?

    Thread Starter prohapro

    (@prohapro)

    Color solution:

    26 return ‘<div class=”remaining”>’.printf(_(‘<span style=”color: #5cb85c”>%s in stock</span>‘),number_format($product->get_stock_quantity(),0,”,”)).'</div>’;

    • This reply was modified 4 years, 6 months ago by prohapro.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customization: color and out of stock’ is closed to new replies.