Author - Ashley Schroder

Hi! I'm Ashley Schroder, the head software engineer at World Wide Access, a company that exports New Zealand products to the world.

I'm an active member of the Magento community, contributing open source extensions to Magento Connect and sharing my Magento experiences through my blog, aschroder.com. You can find helpful tips and advice there on a wide range of Magento development issues.

More Info » Follow me on Twitter »

Reader Comments (58)

  1. Tim Durham
    August 4, 2010 at 2:21 pm /

    Ashley,
    You have provide details for EXACTLY what I need to accomplish. Only I have been unsuccessful. I am hoping you can provide some insight as to what I am doing wrong.

    This is the code I inserted in the:
    app\design\frontend\default\a999\template\catalog\product\view.phtml


    getAttributeText(‘sizing_chart’) == “landau_women_alpha”): ?>
    ?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘landau_women_alpha’)->toHtml() ?>

    I create a block called ( landau_women_alpha ). I inserted an HTML sizing chart in that block. it is set to active.

    I have the attribute ( sizing_chart ) which is a drop down menu. I have various values in the drop down. ( landau_sizing_alpha ) is one of the values.

    The test product is the LAN8219. I set the attribute ( sizing_chart ) titled SizingChart, to the drop down selection of landau_sizing_alpha. I only selected the sizing_chart attribute for the Configurable product that is being displayed and not the “simple products” that make up the Configurable product.

    We have many brands, and for every brand we want to display the Sizing Chart that is indicated in the “sizing_chart” attribute. Once I get this working, I would need the PHP IF statements for every possible attribute value so that it will display the correct Sizing Chart for all products. Is it ok to have multiple “IF” statements? I know nothing about PHP.

    Thanks,
    Tim D.

    Reply
  2. Tim Durham
    August 4, 2010 at 2:23 pm /

    It cut off my code snippet πŸ™ . Will try it again.


    getAttributeText('sizing_chart') == "landau_women_alpha"): ?>
    ?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('landau_women_alpha') ->toHtml() ?>

    Reply
  3. Robert
    August 4, 2010 at 3:36 pm /

    @Tim

    You should simply be able to pull the sizing chart CMS block ID out of your attribute and use it in the createBlock statement without any IF statements like so:


    $sizing_chart_id = getAttributeText('sizing_chart');
    if ($sizing_chart_id) : ?>
    < ?php echo $this->getLayout()->createBlock('cms/block')->setBlockId($sizing_chart_id) ->toHtml() ?>
    < ?php endif; ?>

    The if here is to make sure that you only try to create and display the sizing chart if the attribute is set. You just need to make sure that your sizing_chart attribute values correspond to the CMS Static Block IDs exactly.

    Reply
  4. Ashley Schroder
    August 4, 2010 at 3:43 pm /

    Hi, Tim – also if it’s not working like you expect, try just echoing out the actual value being returned by getAttributeText() something like this (you don’t have to put it in html comments):
    <!– –>

    Then look at the HTML source to check what valu is actually being fetched – maybe it’s not what you expect.

    Reply
  5. Ashley Schroder
    August 4, 2010 at 3:45 pm /

    Woops – it nuked my PHP – it’s just an echo of the getAttribute()

    Reply
  6. Tim
    August 5, 2010 at 1:27 am /

    Robert or Ashley, thanks for the replies. It is still not working for me. Can you tell if I have anything wrong here? (I inserted a space in the < ?php so it would leave all my code)

    getLayout()->createBlock(‘cms/block’)->setBlockId($landau_women_alpha) ->toHtml() ?>

    The “landau_women_alpha” is for sure the value in the sizing_chart attribute that is selected for the configurable product LAN8219. The block id is also saved as landau_women_alpha .

    I have only been working with Magento for 2 months and still learning :0 It seems there should be another file that I have to edit so that when it pulls the block (landau_women_alpha) in, it knows where to place it. Right now, I have put nothing anywhere that would indicate where the block should go.

    I have placed the code I showed you above, at the top of the view.phtml file. I don’t know PHP but I don’t see how the code above is going to properly place the sizing chart (block) at the bottom of the Product Page.

    I would be more than willing to pay one of you to fix this for me then I could see how it was done for other items I may want to dynamically include.

    Tim

    Reply
  7. Tim
    August 5, 2010 at 1:38 am /
  8. Tim
    August 5, 2010 at 3:11 am /

    DISREGARD the previous email. It IS WORKING!! πŸ™‚ I am using the original code format from Ashley. Robert when I tried your code I kept getting a fatal error. So I will just use the original code.

    It really helps when you publish up the page after making changes :0 . Actually I was publishing thru Dreamweaver it was not pushing it up for some odd reason.

    So now I have just a couple of other questions.
    1) Since I have about 15-20 different sizing charts among all of our products, do I need to create a complete IF , ENDIF section for each possibility, or can I just have one IF, and one ENDIF, with all the possibilites in the middle (a complete php line for each option). I hope that makes sense.

    2) Would it be just as easy to do this instead. Right close to where they choose their size, have a small image (ruler image with “Sizing Chart” on it) so that when they click that it brings up a popup window to show the sizing chart instead of having it displayed at the bottom of the page. I am really not 100% sure this would even be better. I would just have to get feedback from a customer to see what they liked better.

    Thanks again for all of your help.

    Tim

    Reply
    1. Robert
      August 5, 2010 at 8:44 am /

      Hey Tim,

      Answer to 1)
      I strongly suggest to use the code I showed here since it will work and is the best solution in terms of flexibility so you don’t have to add or change your if statements whenever you add or change your block id’s. My code probably doesn’t work because I have added spaces to break the lines so you will need to take them out. So here we go with code without spaces (also take out the space in the < ?php):

      < ?php $sizing_chart_id = getAttributeText('sizing_chart'); if ($sizing_chart_id) : ?>
      < ?php echo $this->getLayout()->createBlock('cms/block')->setBlockId($sizing_chart_id)->toHtml() ?>
      < ?php endif; ?>

      Answer 2)
      From a user perspective, this is a good approach since you are providing an answer to their possible question (how do I know which size to choose?) at the point where they need to make the decision. This is what we’ve done on this page: http://staging.canine-spirit.com/grip-trex-boots-set-of-4.html – note the sizing guide button.

      However, to implement this you will need to do a bit more than the snippet of code provided here.

      Reply
  9. Stewart Goodwin
    August 18, 2010 at 9:20 am /

    Robert, your example you provided is beautiful. I am looking for a similar implementation of a sizing chart. Do you have any direction you can provide for the following:

    1 – What is the best js or code to use for the tooltip window that does not conflict with other magento js?

    2 – How did you get your button to be next to your attribute? Is there an extension you’re using to visualize your attributes and allow you to insert the size button adjacent to it?

    I’d love to get the same functionality and would pay for it.

    Reply
    1. Robert
      August 18, 2010 at 10:23 am /

      Hi Stewart,

      thanks for the compliment.

      1 – What is the best js or code to use for the tooltip window that does not conflict with other magento js?

      The JS used for the window is part of a prototype based JS UI component library called Livepipe: http://livepipe.net/. We usually try to find JS plugins that are based on the Prototype library natively included in Magento. We don’t add jQuery (even though we’d prefer it) or any other JS frameworks to keep our JS footprint as light as possible.

      2 – How did you get your button to be next to your attribute? Is there an extension you’re using to visualize your attributes and allow you to insert the size button adjacent to it?

      We did extensive modifications to the site the example is from. Basically, the code showing the sizing guide button is added to the template that displays the configurable product options. It is part of the template customization and needs to be done manually for a specific template.

      The color/size swatches is an extension we developed specifically for this site. We looked at a third party extension (from this site: http://www.temgra.com/index.php/magento-extensions ) but didn’t like any of the offers so we did it ourselves. We also integrated a custom zoomify js for the product images. All in all, quite a bit of work. If you wish to discuss our services and how we could help you, please use the contact form on our LERO9 site (link in the footer) or send me an email to robert [at] this site domain.

      Reply
  10. Tim Durham
    August 18, 2010 at 11:15 am /

    Stewart,
    Without Ashely and Roberts insight I could not have gotten the sizing chart to show up like I wanted. I am not a programmer so I had to take their guidance and try to make it work for my site. It is not beautiful but it works. I summarized what I did for my test site here.

    http://www.magentocommerce.com/boards/search_results/03448088a338a9ecdfb2ca293e7c78f8/

    I gave Ashely and Robert full credit since I could have done nothing without their input. I have tried a couple of approached on the color swatches but we will be going with the Color Swatches Plus with Thumbnails from http://www.temgra.com . She had this example site:
    http://www.johnnie-o.com/index.php/men/men-s-4-button-polo.html and that was really what I was looking for.

    Later,
    Tim

    Tim D.

    Reply
  11. DVN
    DVN
    September 9, 2010 at 4:47 am /

    Hi guys,

    Like Tim, I am attempting to create a dynamic link to a size guide (for example, size guides for “Dress Shirts & Sport Shirts” or “Tees & Knits” and so on). I have successfully made the attribute, and added it to an attribute set, but whenever the code into my view.phtml file, nothing appears – whether it’s the orginal code from Ashley’s awesome article, or Robert’s revised code.

    Any ideas?

    Thanks!

    Reply
    1. Robert
      September 9, 2010 at 10:39 am /

      @DVN
      First, let’s rule out the obvious: have you disabled the Magento cache or refreshed the cache after your phtml changes?

      If yes, and they are not appearing, have you made the change in the correct template file for the design your site is using?

      Provide the code you inserted and your attribute code. Use: < code > … < /code > (without the spaces) to enclose your code parts. You code blocks will look like this:
      < ?php echo $some_php_code; ?>

      Reply
  12. DVN
    DVN
    September 10, 2010 at 7:49 am /

    Hi Robert,

    Thanks for replying! I feel like a moron, but it was the cache, after turning them off I can see the changes. What I entered was:

    getAttributeText('fit_guide_template') == "mens_tees_knits"): ?>
    getLayout()->createBlock('cms/block')->setBlockId('mens_tees_knits')->toHtml() ?>

    However, like Tim – I have mutliple ‘Fit Guides’ that are dependent on the type of product on display (i.e., Sweater Fit guide for sweaters, trouser fit guide for trousers, etc.). I tried your code, but I can’t seem to make it work – would you suggest I just paste in the mutple php if statements?

    Thanks for your help – I’m more of a designer, so my PHP knowledge is limited (read: almost non existent!).

    Cheers,
    DVN

    Reply
  13. DVN
    DVN
    September 10, 2010 at 7:50 am /

    Cut my code off, let my try that again:


    ++++++++getAttributeText('fit_guide_template') == "mens_tees_knits"): ?>
    getLayout()->createBlock('cms/block')->setBlockId('mens_tees_knits')->toHtml() ?>
    ++++++++

    Reply
  14. Dave
    Dave
    September 15, 2010 at 4:47 pm /

    Question regarding how you updated the availability. Magento seems to bundle the availability and pricing into one variable:

    $this->getChildHtml(‘product_type_data’)

    How were you able to separate out the availability in pricing? Let me know if this question doesn’t make sense and I can try and re-word.

    Reply
  15. Tim
    September 16, 2010 at 3:29 pm /

    Robert,
    I am revisiting this. I am really wanting to go with your code so that I don’t have to paste one for each sizing chart. cuz then I would have to modify the view.phtml file everytime I added a new sizing charge and the code on the page could get rather long just from the MANY sizing charts.

    I still can not get it to work. I have inserted this code on the page:

    getLayout()->createBlock('cms/block')->setBlockId($sizing_chart_id)->toHtml() ?>

    This is the message that is showing up on the page:

    Fatal error: Call to undefined function getAttributeText() in /home/userfolder/public_html/store/app/design/frontend/default/a050/template/catalog/product/view.phtml on line 125

    Any ideas on what I am doing wrong?

    Thanks,
    Tim

    Reply
  16. Tim
    September 16, 2010 at 3:31 pm /

    It cut out my code !!!

    getLayout()->createBlock(‘cms/block’)->setBlockId($sizing_chart_id)->toHtml() ?>

    I inserted spaces in the php and div tags. Hopefully it will keep the code this time.
    Tim

    Reply
  17. Tim
    September 16, 2010 at 3:36 pm /


    <?php $sizing_chart_id = getAttributeText('sizing_chart');
    if ($sizing_chart_id) : ?>
    getLayout()->createBlock('cms/block')->setBlockId($sizing_chart_id)->toHtml() ?>

    Reply
  18. Tim
    September 16, 2010 at 4:14 pm /

    Robert,
    It is working now. I had a buddy tell me that I simply needed to make this change:

    change
    $sizing_chart_id = getAttributeText(‘sizing_chart’)

    to:
    $sizing_chart_id = $_product->getAttributeText(‘sizing_chart’)

    Tim

    Reply
    1. Eric
      Eric
      December 10, 2010 at 7:55 pm /

      Great tutorial!!! I needed this for both custom sizing charts as well as custom availability just as your tutorial is setup. However it did not work right away. After a little playing with it I realized the problem lies in ‘if’ statement:
      getAttributeText(‘made_to_order’) == “Made to Order”): ?>

      I simply changed the php call from getAttributeText to getData and it works:
      getData(‘made_to_order’) == “1”): ?>

      THANK YOU THANK YOU THANK YOU.
      Now I am off to try out the custom sizing charts. Also people if you are having similar problems test the output of your attribute by echoing it to the page and then fix the above if statement accordingly.

      Reply
  19. Jen
    Jen
    November 2, 2010 at 6:57 am /

    Hi! I am trying to implement size charts but no luck. I was going to post my question but don’t even know where to start… So I am going to post my code – I know it is wrong (because it’s not working). But I don’t know what to do at this point – have been trying to follow your posts for hours… Please help!!!

    In my case, I have a lot of products from various manufacturers. Every manufacturer has its own size chart. What I want is to be able to choose size chart ID from drop down attribute per product – in my code I am trying to display size chart named “casablanca” by the name of the manufacturer. My drop down attribute name is size_chart_template. And my static block’s name is casablanca.

    (I will add spaces to the code)

    getLayout()->createBlock(‘cms/block’)->setBlockId($size_chart_template)->toHtml() ?>

    Reply
  20. Jen
    Jen
    November 2, 2010 at 7:00 am /

    spaces in the code didn’t help. Trying again:

    < ?php getLayout()->createBlock('cms/block')->setBlockId($size_chart_template)->toHtml() ?>

    Reply
  21. Jen
    Jen
    November 2, 2010 at 7:02 am /

    getLayout()->createBlock(‘cms/block’)->setBlockId($size_chart_template)->toHtml() ? >

    Reply
  22. Jen
    Jen
    November 2, 2010 at 7:02 am /

    how do I post code here? spaces don’t help πŸ™

    Reply
  23. Tim D
    November 2, 2010 at 7:18 am /

    Jen,
    I have never been able to post the code correctly on this page. I am not sure what is wrong. You may capture a screenshot and attach a JPG. That would quick and simple. Robert or Ashley will probably be able to look at it and tell you what is wrong.

    This function works very nice for me

    Reply
  24. Jen
    Jen
    November 2, 2010 at 7:21 am /

    hm.. I don’t see a place to attach images either πŸ™ Do i need to register with this forum to see more functions?

    Reply
  25. DVN
    DVN
    November 2, 2010 at 7:25 am /

    Jen,

    Why not use a site like http://imgur.com/ to upload your image, and then link to it here?

    Reply
  26. Jen
    Jen
    November 2, 2010 at 7:40 am /

    Good idea!

    Here is direct link to my image with code: http://imgur.com/EcVdb.png

    I am not good with PHP so the code is probably looking very ugly πŸ™‚

    Reply
  27. Jen
    Jen
    November 2, 2010 at 7:57 am /

    My code is giving me the error: Fatal error: Call to undefined function getattributetext() referring to the first line of the code. As I understand it means that I am trying to call for something that does not exist. Yes, I don’t have anything that is called $size_chart_template_id – and I am not sure what supposed to go here… Not sure how to read the code…

    I don’t have anything called $size_chart_template_casablanca either – but again, not sure what to put here…

    Any help is appreciated..

    Reply
  28. ashley
    November 2, 2010 at 8:38 am /

    Looks like you’re missing the “$_product->” on getAttributeText() and the “$this->” getLayout() ?

    Reply
  29. Jen
    Jen
    November 2, 2010 at 8:44 am /

    Ok, the error is now gone. But it does not display anything… empty.
    Trying to past my new code… let’s see if it will let me:

    “getAttributeText(‘size_chart_template’);
    if ($size_chart_template_casablanca) : ?>
    $this->getLayout()->createBlock(‘cms/block’)->setBlockId($size_chart_template)->toHtml() ?>”

    Reply
  30. Jen
    Jen
    November 2, 2010 at 8:45 am /

    nope

    Ok, here is the picture with the code: http://imgur.com/OSpkQ.png

    Reply
  31. Jen
    Jen
    November 2, 2010 at 9:05 am /

    Can you please give me sample code with my attribute & block names? I think I am just messing things up because I am not sure how to read and apply the code.

    My attribute name is “size_chart_template”
    My static block name is “casablanca”

    Reply
  32. Jen
    Jen
    November 2, 2010 at 9:20 am /

    I did it! It works!!!! You made me think and I found the problem! Thanx a lot!

    Reply
  33. Robert
    November 2, 2010 at 9:32 am /

    @Jen

    We’ve added improved code support in the comments now. Essentially you can use the <code>[your code here]</code> tags to enter code and/or HTML in the comments.

    To address your question: what value exactly are you putting in the “size_chart_template” attribute? You say it’s a drop-down attribute. Have you set values for it?

    The way I understand what you want to do is:

    Have a drop-down attribute you can assign to your products that contains the Static CMS block ID of the correct sizing chart.

    So, you would have your static CMS blocks set up with ID’s that match your manufacturers such as your “casablanca” one. I suggest you use some naming convention for your CMS blocks like: “sizing_casablanca”. You would enter this in the “Identifier” field on the CMS static block page.

    Your “sizing_chart_template” attribute would then have as one of its values: “sizing_casablanca”. Other values would be like: sizing_manufacturer_a, sizing_manufacturer_b, etc…

    Then, when editing your products, you would select the appropriate sizing chart identifier.

    On the product page phtml the code would be:

    < ?php // get the value of the sizing_chart_template attribute. If set, it should contain a valid Static CMS block identifier $sizing_cms_block_id = $_product->getAttributeText('sizing_chart_template');
    // check if set and only then display the block
    if ($sizing_cms_block_id) :
    echo $this->getLayout()->createBlock('cms/block')->setBlockId($sizing_cms_block_id)->toHtml();
    endif;
    ?>

    It’s important to set all the things up correctly first and don’t forget to disable or refresh the cache when testing.

    Reply
  34. Jen
    Jen
    November 2, 2010 at 9:38 am /

    Here is my working code:


    < ?php if ($_product->getAttributeText('size_chart_template') == "casablanca"): ?>
    < ?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('casablanca')->toHtml() ?>
    < ?php endif; ?>

    Reply
    1. Robert
      November 2, 2010 at 9:47 am /

      @Jen

      This will work but it’s not very flexible. You are checking if your attribute has the value “casablanca” effectively hard-coding one specific attribute value for all your products, but this will not be the case for other sizing charts. Try to follow the steps outlined in my comment above to create a more flexible solution.

      Reply
  35. Jen
    Jen
    November 2, 2010 at 9:48 am /

    Maybe I am pushing my luck – but since you’re professional…

    Since I am inserting html data from static block via drop down attribute – sometimes there is too much info to be inserted into product page. What I am looking for is combining this code


    < ?php if ($_product->getAttributeText('size_chart_template') == "casablanca"): ?>
    < ?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('casablanca')->toHtml() ?>
    < ?php endif; ?>

    with this java script code


    Size Chart

    to get link that opens in a new window on click and displays the info that is in the block…

    Any idea? And let me know if my request is beyond what you can help me with…

    Reply
    1. Robert
      November 2, 2010 at 9:59 am /

      @Jen

      What you are asking is beyond this tutorial. Basically, you could have an initially hidden div containing your sizing guide as per code above and then use javascript to show the div when a link is clicked.

      The window.open() won’t work in this case as you don’t have a “page” as such so you’d need to use a prototype plugin or library that can show arbitrary HTML in a popup – lightbox style. Magento already comes with the window.js library (/js/prototype/window.js) you can use to show popups.

      Reply
      1. Jen
        Jen
        November 2, 2010 at 10:01 am /

        Thank you! I will try and figure this out.

        Reply
  36. Jen
    Jen
    November 2, 2010 at 9:58 am /

    I got it working the “flexible” way! Thank you so much!!! Such a relief…

    Reply
  37. duu
    duu
    December 6, 2010 at 12:52 pm /

    very useful tips!

    Reply
  38. Sharon
    December 13, 2010 at 8:11 pm /

    @Tim
    I was trying to locate your full tutorial of how to do the size chart thing like Robert, but without any luck.
    Do you have the directions somewhere?
    Cheers,
    Sharon

    Reply
  39. Inessa
    Inessa
    February 2, 2011 at 3:58 am /

    Thanks, Great tips . Work for me

    Reply
  40. Elemental
    March 21, 2011 at 2:12 pm /

    Thanks for the great tutorial.
    It is exactly what I am looking for.

    To play Devil’s Advocate:
    Using the Jean Sheepskin Low Boot example
    Is there a way you can select size standard (EUR, US/CAN,UK)
    Then based on that selection, see the appropriate size.

    For Example:
    Select Region: EUR > Select Size: 39,40,41 (in drop down menu)
    Select Region: US/CAN > Select Size: 8.5,9,9.5 (in drop down menu)

    I saw you were using ‘US 8’ in your size listings. I think
    implementing a conditional selector like this would take
    this example to the next level!

    Thanks again for sharing your knowledge!

    Reply
  41. Eric
    July 16, 2011 at 2:14 pm /

    Perfect answer to my problem. My client wanted to quickly swap between items that her vendor wouldnt allow online sales aka “view only” and the normal magento product sale screen. Thanks!

    Reply
  42. holly
    holly
    December 23, 2011 at 6:32 am /

    This helped a lot!
    I have this working with specific values for an attribute. Is there a way to have it show up ONLY if the value is Empty?
    thanks

    Reply
    1. Robert Popovic
      December 23, 2011 at 2:25 pm /

      Depending on what type of attribute you are checking for, often an empty attribute will contain “No” if the attribute is a multi select or drop-down so you could check for:

      if ('no' == strtolower(getAttributeText('my_attribute_code)) || !getAttributeText('my_attribute_code')) {
      // do your processing
      } else ...

      To make sure, you can just echo the attribute value and see what comes out when it’s blank and use that in your if statement.

      Reply
  43. anoop
    anoop
    December 26, 2011 at 11:11 pm /

    can anyone help me to get out an image editor in magento

    Reply
  44. Hans
    Hans
    April 27, 2012 at 8:15 pm /

    Hey,

    Thanks, great post! Does someone know how this works with a whole attribute set? If attributeset = X than show me this block?

    Thanks!

    Reply
  45. Reid B.
    Reid B.
    December 22, 2012 at 5:25 am /

    This isn’t exactly in-line with what you’re talking about – but I’ve taken this idea one step further, and made it so that instead of showing an item’s weight, you can show how much it will cost to ship it (if flat-rate) as a call-to action. The site I used this for is a kayak, canoe, & SUP retailer so they have large flat-rate freight shipments frequently. It is used in conjunction with a flat-rate plugin known as Webshopapps Matrix Rates:

    <?php if ($_product->getweight() > "155.0000" && $_product->getweight() < "187.0000"): ?>
            <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('flat50')->toHtml() ?>
    <?php endif; ?>
    <?php if ($_product->getweight() > "186.0000" && $_product->getweight() < "208.0000"): ?>
            <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('flat100')->toHtml() ?>
    <?php endif; ?>
    

    This simple snipit of code – if inserted properly on the view.phtml file – will return whatever you might have in each block respectively. So – say a smaller kayak between 155.0000 lbs and 187.0000 lbs is being viewed – it will show the customer that the item ships for $50 with a static-block call-out before they have to estimate shipping. Or – say they view a larger tandem boat – it will show the customer that it ships for a flat-rate of $100. This is a better incentive to buy than simply stating the weight of the boat (which is already stated within the product description).

    Reply
  46. Anil
    Anil
    April 10, 2013 at 5:30 am /

    I have a multi select attribute called “compostion”(having valid values like a,b,c etc). In my product page for Product X (having “composition” attribute set to a,b), i will like to show all other products name and price which have the same values in “composition” attribute(a,b).

    Reply
  47. Mike
    Mike
    July 11, 2013 at 7:16 pm /

    I can’t seem to get this to work in Magento 1.7.0.2

    I followed the steps very closely, but nothing happens. Anyone else using 1.7.0.2?

    Reply
  48. Mike
    Mike
    July 11, 2013 at 8:47 pm /
    <?php if ($_product->getAttributeText('made_to_order') == "Yes"): ?>
        <p class="availability in-stock"><?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('made_to_order')->toHtml() ?>
    <?php endif; ?></span></p>
    
    
    <?php if ($_product->isAvailable()): ?>
        <p class="availability in-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('In stock') ?></span></p>
    
    <?php else: ?>
        <p class="availability out-of-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('Out of stock') ?></span></p>
    <?php endif; ?>
    Reply
  49. Andy
    May 27, 2014 at 10:57 am /

    Does anybody know how to get multiple of these on a single product page, so my customers can purchase multiple variation of each product on without having to come back to the page. A table or matrix?

    Reply
  50. Philipp
    January 7, 2015 at 8:21 am /

    how would you hide the delivery time for products that are out of stock?

    Reply

Add a Comment & Join the Discussion

Insert small snippets of code by using [code]{your_code_here}[/code]
For larger code blocks please use http://pastebin.com and paste your link.

You may also use the following HTML in your comment: <a href="" title=""> <abbr title="">
<acronym title=""> <blockquote cite=""> <cite> <em> <strike> <strong>