1
I am making a module for displaying the quantity of stock on the product page only if the quantity is less than that defined in the options. beauty, but my question is:
O estoque está com menos que %s unidades
. I want to know how to reference the variable %s within my message!?
code used to build the 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, for sure, 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 take the option to have the value click on the final message. Thank you