Magento CE 1.9 Questions and Answers Part 3

Magento CE 1.9 Questions and Answers Part 3

It’s been pretty busy here at FME, since we were building lots of plugins and also planning for holiday season. Most of our visitors are now asking for 1.9 supported extensions and we are in a process of upgrading remaining modules to Magento 1.9. This post follows the series of Magento 1.9 questions and answers on FMEExtensions blog. Let’s dive into next set of hot questions and answers that community has for 1.9. Last Roundup: Magento 1.9 Questions and Answers Part 2 Note: If you need Magento 1.9 Supported Extensions, please visit our Store

The answers posted to these questions are by the community members, and do not necessarily reflect FMEExtension's opinion.

Question 1: I get following error when I try to display my products attributes on product view page:

Call to a member function getSortedChildren() on a non-object in /template/catalog/product/view/type/options/configurable.phtml on line 32

On line 32 I see,

$_renderers = $this->getChild('attr_renderers')->getSortedChildren();

How can I resolve it?

Solution:

Make sure you have this in your catalog.xml layout file of your theme inside the layout handle <PRODUCT_TYPE_configurable>

<reference name="product.info.options.wrapper">
        <block type="catalog/product_view_type_configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="catalog/product/view/type/options/configurable.phtml">
            <block type="core/text_list" name="product.info.options.configurable.renderers" as="attr_renderers" />
            <block type="core/text_list" name="product.info.options.configurable.after" as="after" />
        </block>
    </reference>
  If it does not work, you can copy the file which is suggested in the error message to your theme and replace this:
foreach ($_renderers as $_rendererName):
        $_renderer = $this->getChild('attr_renderers')->getChild($_rendererName);
        if (method_exists($_renderer, 'shouldRender') && $_renderer->shouldRender($_product, $_attribute, $_jsonConfig)):
            $_renderer->setProduct($_product);
            $_renderer->setAttributeObj($_attribute);
            echo $_renderer->toHtml();
            $_rendered = true;
            break;
        endif;
    endforeach;
  with this:
$attRenderes = $this->getChild('attr_renderers');
    if ($attRenderes) : 
        foreach ($_renderers as $_rendererName):
 
            $_renderer = $this->getChild('attr_renderers')->getChild($_rendererName);
            if (method_exists($_renderer, 'shouldRender') && $_renderer->shouldRender($_product, $_attribute, $_jsonConfig)):
                $_renderer->setProduct($_product);
                $_renderer->setAttributeObj($_attribute);
                echo $_renderer->toHtml();
                $_rendered = true;
                break;
            endif;
        endforeach;
     endif;
    Question 2. There are several classes in the Zend folder in app/code/core,  do not understand why these are needed. Solution:  Question 3. After update php from 5.5.16 to 5.6.0 on my VPS I got this 2 errors in [magento]/var/log/system.log:
ERR (3): Deprecated functionality: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated  in [magento]/lib/Zend/Locale/Format.php on line 311
ERR (3): Deprecated functionality: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated  in [magento]/lib/Zend/Locale/Format.php on line 472

I don’t have any issues with encoding on frontend and backend, should I ignore this error, what is the correct way to resolve it?

Solution:

 You should not be using Magento with PHP 5.6 now, there is not any official patch and statement.  PHP 5.6 deprecated few functions, if you have set the correct encoding, then call to this function is not needed.  But use 5.5.16 instead of this version.

Question 4. I noticed Magento's API allows you to get order credit card information. Why is this an option?

Solution:. It allows you to pull credit card information, I believe, if you are using saved credit card payment method for testing purpose. Its suggested that do not use this payment option on live site.

Question 5: After upgrading from Magento 1.4 to 1.9 I do not see any orders, invoices, shipments and actually no data related with old sales! I did test transaction and it could see the order. Whats wrong?

Solution: There is a large restructuring in the database files in these versions. In the previous version like 1.4 the naming is “sales_order” but in new version its renamed as “sales_flat_order”. The solution is to migrate to new tables.