Adding external JavaScript file to Magento

To add an external JS without any problem use this: <reference name=”head”> <block type=”core/text” name=”google.cdn.jquery”> <action method=”setText”> <text> <![CDATA[<script type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js”></script><script type=”text/javascript”>jQuery.noConflict();</script>]]> </text> </action> </block> </reference>

Magento: Set LIMIT on collection

There are several ways to do this: $collection = Mage::getModel(‘…’) ->getCollection() ->setPageSize(20) ->setCurPage(1); Will get first 20 records. Here is the alternative and maybe more readable way: $collection = Mage::getModel(‘…’)->getCollection(); $collection->getSelect()->limit(20); This will call Zend Db limit. You can set offset as second parameter.

Please enter a valid URL. Protocol is required (http://, https:// or ftp://) in Magento 1.9.2 installing?

Resolve this issue by the following methods (from good to worse): 1) Inspect the url field and delete the class ‘validate-url’ to stop validation from the field and proceed the process. have a good Luck guys. OR 2) just mark the “Skip Base URL Validation Before the Next Step” checkbox. OR 3) use 127.0.0.1 instead …

Read more

Fatal error: Uncaught Error: Function name must be a string in C:\xampp\htdocs\em0126\app\code\core\Mage\Core\Model\Layout.php:555 Stack trace: #0

Your solution Fatal error: Uncaught Error: Function name must be a string in … app\code\core\Mage\Core\Model\Layout.php:555 … This error was easy to fix because the problem was in the following line: $out .= $this->getBlock($callback[0])->$callback[1](); Instead it should be: $out .= $this->getBlock($callback[0])->{$callback[1]}(); find your detail solution here on below given link http://www.code007.ro/making-work-magento-with-php-7-rc1/

Twitter Bootstrap 3 dropdown menu disappears when used with prototype.js

I’ve also used code from here: http://kk-medienreich.at/techblog/magento-bootstrap-integration-mit-prototype-framework but without a need to modify any source. Just put code below somewhere after prototype and jquery includes: (function() { var isBootstrapEvent = false; if (window.jQuery) { var all = jQuery(‘*’); jQuery.each([‘hide.bs.dropdown’, ‘hide.bs.collapse’, ‘hide.bs.modal’, ‘hide.bs.tooltip’, ‘hide.bs.popover’, ‘hide.bs.tab’], function(index, eventName) { all.on(eventName, function( event ) { isBootstrapEvent = true; …

Read more

Magento XML using before/after to place blocks hardly ever works

The before and after attributes only work in one of two cases: When you insert into a core/text_list block When your template block calls getChildHtml without any parameters When you say <reference name=”root”> <block type=”core/template” name=”example_block” before=”content” template=”page/html/example-block.phtml”/> </reference> you’re telling Magento Hey Magento, put the example_block inside the root block. When you put a …

Read more