Calcetines Extreme

Calcetines Extreme
Take care of you using the best socks

Sunday, January 12, 2014

#magento | Call Statics Bllock in a .phtml file

You would like to add a Static Block, that you can define inside "CMS" -> "Static Block" on another page or section that are not included in your template. 

There are various ways to call your static blocks to your Magento fronted but that is one of the best ways to add it in the .phtml and xml files. just follow the nest steps:

1.- Create a CMS Static Block at "CMS"->"Statick Block"->"Add new block"

2.- Add the next sentence inside -phtml
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId(cms_test_block)->toHtml() ?>

for example, if you need to add some Statick block inside the Copyright, you have to edit the next .phtml like this:


<div class="footer-container">
    <div class="footer">
        <?php echo $this->getChildHtml() ?>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId(CopyRight)->toHtml() ?>

Sunday, January 5, 2014

#magento - System Configuration -> Save Config Button dosen't work

You found that on Magento Backoffice, the "Save Config" button´dose't work and you can't save any modification that you do on each group on magento configuration. If you use browser inspector you can see that there is some errors on inspector console, like "Uncaught SyntaxError: Unexpected token ILLEGAL", and when you try to click on the button you can see a lot of prototype.js error messages.

That is because prototype.js used by Magento core is not friendly with jquery library, to solve that you have to add a title modification on your jquery library as indicated on the next steps:

Path:  /httpdocs/p/skin/frontend/base/default/rokmage-main-js/
File:    jquery.min.js

Open that file and add that statement at the end:   "jQuery.noConflict();"
You will have that file like that:
/*! jQuery v1.8.3 | */
(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-
define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window);jQuery.noConflict();