Tuesday, February 14, 2017

How to download a Magento extension directly

Note: This post is written for Magento version 1.x.x. This post does not target Magento versions 2.x.x.

Sometimes there are situations when we can't install extension via Magento Connect Manager in Magento. In such situations we may need to download the extension's files directly.

Below are some easy ways by which we can download Magento extension directly (without Magento Connect Manager):{PACKAGE NAME}/{VERSION}/{PACKAGE NAME}-{VERSION}.tgz

where {PACKAGE NAME} can be found from extension's key's last part and {VERSION} can be found under release notes tab on extension's page.

For example, you want to download the "Order Delivery Date" module as TGZ (.tar.gz) archive from Magento Connect.

1. Open Magento Connect page of the module:

2. Note down last release version number from the 'Release Notes' tab.

In our sample last version of the module is "0.1.9".

3. Check an Extension key for "Magento Connect 2.0".

For our module the Extension key is:

4. Configure URL for downloading and open it in your browser:

Please try above ways and let me know if you find any trouble.

Thanks for visiting 😊

Thursday, January 12, 2017

Custom CMS field showing widget calling code in frontend in Magento

I added custom field for CMS pages and wanted to show its value in sidebar.

Field type: Textarea
Wysiwyg: Enabled
Field Name: content_custom

I wanted to call a widget in content of this custom field.

For reference, I added below code to call widget:

{{widget type="cms/widget_page_link" anchor_text="My Custom Link" title="My Custom Link" template="cms/widget/link/link_block.phtml" page_id="153"}}

When I tried to show field's value in frontend, it displayed content as it was inputted from cms page:

{{widget type="cms/widget_page_link" anchor_text="My Custom Link" title="My Custom Link" template="cms/widget/link/link_block.phtml" page_id="153"}}

instead of rendering its html.

Solution: To render html instead of code calling widget, use below code:

echo Mage::helper('cms')->getBlockTemplateProcessor()->filter(Mage::getBlockSingleton('cms/page')->getPage()->getContentCustom());

Please try this code and let me know if you find any problem.

Thanks for visiting.

Monday, July 4, 2016

How to add a datetime picker input field in admin module form in magento 1.x

To add a date/time input field in admin form in magento 1.x, you need to simply use code like below:

$dateFormatIso = Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
$fieldset->addField(‘time_from’, ‘date’, array(
‘name’ => ‘time_from’,
‘class’ => ‘required-entry’,
‘required’ => true,
‘label’ => Mage::helper(‘event’)->__(‘Time From’),
‘image’ => $this->getSkinUrl(‘images/grid-cal.gif’),
‘input_format’ => Varien_Date::DATETIME_INTERNAL_FORMAT,
‘format’ => $dateFormatIso,
‘time’ => true, //if you don’t want time, then simply set ‘time’ => false,

Friday, January 1, 2016

Eliminate render-blocking JavaScript and CSS in above-the-fold content in Magento

To remove render-blocking JavaScript issue in Magento using layout xml directly simply add either <params>defer</params> or <params>defer</params> before </action> tag.

For example:

<action method="addJs"><script>prototype/prototype.js</script></action>

Replace it with following:

<action method="addJs"><script>prototype/prototype.js</script><params>defer</params></action>


<action method="addJs"><script>prototype/prototype.js</script><params>async</params></action>

Saturday, December 26, 2015

Delete mysql user and revoke all privileges properly in mysql

If you want to remove all the privileges and start totally from scratch do the following:

    Revoke all privileges on database level:

    REVOKE ALL PRIVILEGES ON dbname.* FROM 'username'@'hostname';

    Drop the user:

    DROP USER 'username'@'hostname';

Above procedure will entirely remove mysql user from your instance, this means you can recreate him from scratch.

Wednesday, December 16, 2015

Attribute options are not deleting in magento

It may happen due to lesser php value of max_input_variable.

To fix this problem open .htaccess file of magento's document root and write this in it:

php_value max_input_vars 2500
You can also do the same by adding/changing max_input_vars value from active php.ini of your server.
max_input_vars = 2500

Thursday, September 10, 2015

Add link to category page by id from cms static block/cms page in Magento

If you want to add a link for category page from cms page or cms static block, simply use the category link widget inline link code:

{{widget type="catalog/category_widget_link" anchor_text="Displayed Text" title="Title attribute text" template="catalog/category/widget/link/link_block.phtml" id_path="category/22"}}

There is no need to add <a> tag from cms pages or static blocks.