How to load value from the TEXT field of the module typed in the admin to the frontend?

Asked

Viewed 101 times

0

I have a custom module with a field: "Enter your custom message".
I want to load this field into a block on the product page where it says "In Stock" (or In Stock, in Portuguese). So far so good, I could simply modify the message from the app/design/frontend/rwd/default/template/Catalog/product/view/type/Availability/default.phtml file:

<p class="availability in-stock">
   <span class="label"><?php echo $this->helper('catalog')->__('Availability:') ?></span>
   <span class="value"><?php echo $this->helper('catalog')->__('In stock') ?></span>
</p>

Where I would change the field within the '', but what I want is for this change to be made by my module, and for that I already have mine default in the module folder inside the template, the import via LAYOUT.xml:

<reference name="product.info.availability">
    <action method="setTemplate"><template>stockmessages/catalog/product/view/type/availability/default.phtml</template></action>
</reference>

Fine, but I was researching ways to give load of that TEXT field in my frontend, and what I found was something like:

echo $_product->getAttributeText('campo_criado_na_system.xml')  

However it does not work by giving error in product.php of the core, I believe that the way to take the value of the text field in ADMIN to load in FRONTEND be otherwise, can anyone help me? Thank you.

1 answer

0


The answer was simple, here it is, I was able to correct my doubt.

Mage::getStoreConfig('primeiraopçaonosystemXML/segunda/terceira....')

This causes you to take the result of the value of your preset field in your module settings and display it in . Phtml

Browser other questions tagged

You are not signed in. Login or sign up in order to post.