Magento Forum

Page 2 of 2
Change product Availability options to include “imidiate, 10 days etc”
 
chadjmorgan
Sr. Member
 
Avatar
Total Posts:  252
Joined:  2010-06-04
Michigan
 
becms - 07 July 2010 06:15 AM

You should only use this code if availability is an drop-down:

<class="availability in-stock"><?php echo $this->__('Availability:'?> <span><?php echo $_product->getAttributeText('availability'?></span></p>

If it’s a text field, use the one I mentioned above.

thanks so much!

 
Magento Community Magento Community
Magento Community
Magento Community
 
upwebstore
Jr. Member
 
Total Posts:  29
Joined:  2012-09-19
 

Hello,…
I tried to make these steps in magento 1.7, the configuration are ok, but didn´t show any value.
Why it´s possible?

oldcreekwbf - 28 February 2010 02:45 PM

Heres a really easy and quick solution for this problem, which requires you to only change 1 line of code.

First create an attribute in the back-end (aka admin) of magento and label it availability. Set it up how ever you like.

Then in the file app/design/frontend/default/default/template/catalog/product/view/type/simple.phtml change line 36

from:

<class="availability in-stock"><?php echo $this->__('Availability:'?> <span><?php echo $this->__('In stock'?></span></p>
to:
<class="availability in-stock"><?php echo $this->__('Availability:'?> <span><?php echo $_product->getAttributeText('availability'?></span></p>

What this code change does is instead of always saying ‘In Stock’ it will simply output whatever you select for the availability attribute.

Bonus Tips:
1 - First you should create a local copy of simple.phtml as to not alter the original. But if that doesn’t make sense, then don’t worry about it
2 - This works only on simple product types. But it should be really easy to open up the other files (ex: configurable.phtml or grouped.phtml) and make the necessary changes.
 
Magento Community Magento Community
Magento Community
Magento Community
 
brunabr
Member
 
Total Posts:  39
Joined:  2010-02-01
 

Was working perfectly on my magento 1.3.2.4 but the 1.7 does not work… Whyyyyyyyy :T

 
Magento Community Magento Community
Magento Community
Magento Community
 
brunabr
Member
 
Total Posts:  39
Joined:  2010-02-01
 

I found a solution for 1.7 version!

Change the file default.phtml line:

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

to

<p class="availability in-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $_product->getAttributeText('availability') ?></span></p>

The file can be found:

app / design / frontend / default / YOUR THEME NAME / template / catalog / product / view / type / default.phtml

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 2