I am making a module for displaying the stock quantity on the product page only if the quantity is less than the one defined in the options. beauty, but my question is:
O estoque está com menos que %s unidades
. I want to know how do I reference the variable% s within my message !?
code used to build config.xml
<stockmessages>
<option>
<stockmessages_enable>1</stockmessages_enable>
<stockmessages_min_qty>5</stockmessages_min_qty>
<stockmessages_message>The stock is below than %s items</stockmessages_message>
</option>
</stockmessages>
This allows me to load a default message, right, and follow the code when using it in my default.phtml:
<p class="availability in-stock"><?php $quantity=Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty(); if($quantity<= Mage::getStoreConfig('stockmessages/option/stockmessages_min_qty')) { echo Mage::getStoreConfig('stockmessages/option/stockmessages_message') . intval($quantity) . " ";} ?></p>
The question is how to insert a variable into the custom message and pick up the option for the value to load into the final message. Thanks