MageBees Blog for Magento

Magento solutions, Sell Magento Extensions, Magento Design and Development Services

  • How To Install Magento 2 Extension Using Web Setup Wizard

    Download extension and move folders from archive to <your Magento install dir> < Magento Root >/app/ directory.

    Login to your Magento 2 Admin Panel.
    1. Go To System -> Web Setup Wizard. you will get following screen.
      • Magento Admin Menu
    2. Click On the component manager.
      • Component Manager
    3. Enable / Disable Module Using Component Manager. Here is the list of component which are currently available in your store and find your component which you want to enable / disable.
      • manage_module
    4. Readiness Check Error : You need to check your server configurations with your magento version using the following links and make changes as per the magento requirements.
      Step 1: Readiness Check
      Cron Job Error
      • Follow below steps for fixing check cron scripts issue:

        You need to setup cron job for every one minute on the server using the following steps.

        • Open Terminal /command prompt and change directory to your magento root directory.
        • To create a cron job for the Magento file system owner, enter the following command as a user with root privileges:

        crontab -u magento_user -e

        You need to setup following command into your cron tab file.

        • * * * * * path to php binary -c path to php.ini file magento install dir/bin/magento cron:run | grep -v "Ran jobs by schedule" >> magento install dir/var/log/magento.cron.log
        • * * * * * path to php binary -c path to php.ini file magento install dir/update/cron.php >> magento install dir/var/log/update.cron.log
        • * * * * * path to php binary -c path to php.ini file magento install dir/bin/magento setup:cron:run >> magento install dir/var/log/setup.cron.log

        path to php binary : which php

        path to php.ini : php --ini

        magento install dir : is the directory in which you installed the Magento software; for example, /var/www

      • Follow below steps for fixing PHP Setting Check * :
        • For fix this issue you need to make changes in the php.ini file as per explain in the following link and restart your server.Required PHP settings
        • Note : When you change in the php.ini file and getting same error then need to pass php master variable value in the command like following.

        Example : Here we setup always_populate_raw_post_data=-1 using following command in the cron job.

        • * * * * * path to php binary -d always_populate_raw_post_data=-1 -c path to php.ini file magento install dir/bin/magento cron:run | grep -v "Ran jobs by schedule" >> magento install dir/var/log/magento.cron.log
        • * * * * * path to php binary -d always_populate_raw_post_data=-1 -c path to php.ini file magento install dir/update/cron.php >> magento install dir/var/log/update.cron.log
        • * * * * * path to php binary -d always_populate_raw_post_data=-1 -c path to php.ini file magento install dir/bin/magento setup:cron:run >> magento install dir/var/log/setup.cron.log
      • Now your Readiness Check is completed so please check it.

      Readiness Check Completed
      Step 2: Create Backup : You will able to take backup by selecting backup options which you want to take before installing the module.
      Back Up Selection Selection_149
      Step 3: Enable Module

      Enable Module When you click on the Enable Module button then it will take time and after then it will show process like following. Selection_150 Selection_151 Once Module Install Successfully then it will redirect to the Success Page. Module Successfully Install

    5. Once Installation is completed then it will show component in the component manager list. Component manager

  • How To Install Magento Security Patch SUPEE-8788

    The patch addresses following:

    1. Zend framework and payment vulnerabilities
    2. Ensures sessions are invalidated after a user logs out
    3. Makes several other security enhancements


    First of all you need to check out that old patches had been installed correctly or not. In magento patches depend on the other older patches, so you need to check which patches have been install in your site using any of the following methods.

    1. Scan your site at : MageReport
    2. Scan your site at :MageScan
    3. Following file lists off all currently applied patches which are applied using ssh.

      Open <your Magento install dir> < Magento Root >/app/etc/applied.patches.

    Installation Process :

    1. Please Disable Magento Compiler at System > Configuration > Tools > Magento Compiler and clear compiled cache.
    2. NOTE: if you have installed 8788v1 of the patch, it is recommended to do the following:

      Before Apply 8788v2 Patch:

      • Revert SUPEE 8788 v1 (if installed)
      • Revert SUPEE 1533 (if installed)
      • install SUPEE 3941 (if not installed)
      • install SUPEE 8788 v2

     



    Using SSH :

    Step 1: Please make sure to download the patch according to your magento verstion , download patches from https://www.magentocommerce.com/products/downloads/magento/ .

    Step 2: Upload downloaded file at your magento root directory using FTP/Cpanel.

    Step 3: Now Login in the SSH server then go to magento root directory.

    Step 4: Run Patch in your ssh terminal using following command from your magento root directory.

    For Apply Patch:

    SH PATCH_SUPEE-8788_CE_1.9.2.4_v2-2016-10-14-09-42-47.sh

    Revert Patch:

    SH PATCH_SUPEE-8788_CE_1.9.2.4_v2-2016-10-14-09-42-47.sh -R;

    Step 5: Now, clear the cache and enable compilation.

    Possible Issues :

    1. Make sure you haven’t deleted or renamed the “Downloader” directory else the patch installation will fail as it patches a file within the downloader directory. The best solution is to restore the directory, apply patch and rename Downloader folder again.
    2. Skipping patch.

      1 out of 1 hunk ignored -- saving rejects to file skin/adminhtml/default/default/media/flex.swf.rej

      patching file skin/adminhtml/default/default/media/uploader.swf

      Reversed (or previously applied) patch detected! Assume -R? [n]

      Apply anyway? [n]

      Skipping patch.

      1 out of 1 hunk ignored -- saving rejects to file skin/adminhtml/default/default/media/uploader.swf.rej

      patching file skin/adminhtml/default/default/media/uploaderSingle.swf

      Reversed (or previously applied) patch detected! Assume -R? [n]

      Apply anyway? [n]

      Skipping patch. 1 out of 1 hunk ignored -- saving rejects to file skin/adminhtml/default/default/media/uploaderSingle.swf.rej

      The 8788 patch contains binary content. As Magento does not provide any direct download links, you have to download the patch to your computer and upload it with an file-transfer application to your server.

      Solution: We need to set transfer type to binary when using FileZilla to upload the .sh patch file to your Magento root.




    With Out SSH

    Download the zip file for the patch installation and then upload that files at your magento root directory.

    Magento version SUPEE-8788
    Magento 1.9.2.4 patch_supee-8788_ce_1-9-2-4_v2
    Magento 1.9.2.3 patch_supee-8788_ce_1-9-2-3_v2
    Magento 1.9.2.1 patch_supee-8788_ce_1-9-2-1_v2
    Magento 1.9.1.1 patch_supee-8788_ce_1-9-1-1_v2
    Magento 1.9.0.1 patch_supee-8788_ce_1-9-0-1_v2
    Magento 1.8.0.1 patch_supee-8788_ce_1-8-1-0_v2
    Magento 1.7.0.2 patch_supee-8788_ce_1-7-0-2_v2

     

    Delete all files under media skin\adminhtml\default\default\media

    1. < Magento Root >/skin/adminhtml/default/default/media/flex.swf
    2. < Magento Root >/skin/adminhtml/default/default/media/uploader.swf
    3. < Magento Root >/skin/adminhtml/default/default/media/uploaderSingle.swf


    Also checks for the following files that have been modified:

    1. < Magento Root >/js/mage/adminhtml/uploader/instance.js
    2. < Magento Root >/skin/adminhtml/default/default/boxes.css



    Check following after install patch:

    • Check all CMS, Shipping, Payment and landing pages are loading correctly without any issues.
    • Magento security patch SUPEE 8788 affects the page sessions, CMS, file upload, admin pages and downloadable products.
  • Magento 1- Troubleshooting Import Export Products extension's errors

    • Q-1: I am getting “Unable to open file!” error?

      Ans: This error comes because of your magento setup not having “import” and “export” folder in var directory. This both folder recommended for run extension. So please create it.

    • Q-2: I am not able to see your extension in admin menu bar.

      Ans: Please clear cache once and re-login to your admin once. If you still not getting extension menu bar in admin panel then please Disable compilation/recompile.

    • Q-3: Products import working fine but QTY showing blank. How i can solve?

      Ans: This is caused by improper CSV format. Please use openoffice.org calc spreadsheet application and saving in UTF-8 format. OR Please use Google Doc for Convert Your CSV in UTF-8 format.

    • Q-4: What I do when products import going correctly with no single errors but they don't show on font-end until I re-edit and save it?

      Ans: It’s because you are missing the “options_container” column in your csv and its values. These are required and it’s recommended not to change or remove columns or remove it.

    • Q-5: How to create or manage parent and child category?

      Ans: Here some string mention for category column. Explained bellow.

      Category Column String : Parent Category, Parent Category/Child Category, Parent Category/Child Category/ Sub Child Category

      Parent Category: If you use this string then it will create Parent Category.

      Parent Category/Child Category: If you use this string then it will create Parent Category first, then it will create Child Category.

      Parent Category/Child Category/ Sub Child Category: If you use this string then it will create Parent Category first, then it will create Child Category and then create Sub Child Category.

      Note: You can also define category ids if you already created categories. But for that you need to change header from categories to category_ids.

    • Q-6: Import Screen Showing” Fatal error: Call to a member function getId() on a non-object” ?

      Ans: This error comes because of you not created attribute which you mentioned in CSV. OR attribute is not assigned to attribute set.

    • Q-7: Import Screen Showing” Fatal error: Call to a member function getAttributeCode() on a non-object” ?

      Ans: This error comes because of you not created attribute which you mentioned in CSV. OR attribute is not assigned to attribute set.

    • Q-8: How many validation log and import log , can I see ?

      Ans: You can just see last validation and import log. If want to keep validation/import log , then you can export it from validation or import tab in CSV format.

    • Q-9: I am getting max execution time error, what I have to do?

      Ans: If you getting time out error then you have to increase your server max execution time. For that you have to consult you hosting support team.

    • Q-10: I am getting “ 'var/export' directory does not exist !” error?

      Ans: This error comes due to var/export directory does not exists or not having write permission.

    • Q-11: I am getting “ 'var/import' directory does not exist !” error?

      Ans: This error comes due to var/import directory does not exists or not having write permission.

    • Q-12: I am getting below error while try to import the products.

      Ans: This error occur becasuse of your csv file is not properly created or converted in UTF-8 Format. So you have to convert your csv file in UTF-8 format for resolve this error. For Convert your file in UTF-8 please follow below steps.

      Using Google Sheets:

      • Go to https://www.google.co.in/sheets/about/ login using your gmail account. Click on Blank.
      • Go to File -> Open and upload your file.
      • After upload your file File -> Download as -> Comma-seperated values (.csv, current sheet)
      • Your file will be start downloading.

      Note: Don't forget to remove space from file name.

    • Q-13: Image not importing when path propely define in CSV image fields.

      Ans: For import or update images properly you have to define four image related columns in your csv file. "image" , "small_image" , "thumbnail" and "gallery". No matter there is value in gallery column or not but you have to define it.

    • Q-14: I am getting below error while try to import the products.

      Ans: This error occur when you deleted default Magento store and our extension not able to find out your store code. When you get this error then please contact our support team regarding this issue.

  • Useful commands for Magento 2

    Below are some useful commands for Magento 2

    All magento 2 commands has to be executed from magento project root directory

    1. For Re-indexing

    php bin/magento indexer:reindex

    2. For Flushing Cache

    php bin/magento cache:flush

    3. For Cleaning Cache

    php bin/magento cache:clean

    4. For Compilation

    php bin/magento setup:di:compile

    5. For Upgrading: This command is very useful as if you make any changes/install/set up magento module you will have to execute this command. Once this command execution completes, this will ask to re-run complilation command.

    php bin/magento setup:upgrade

    6. To check Magento Mode:: production/default OR developer

    php bin/magento deploy:mode:show
    php bin/magento deploy:mode:set developer
    php bin/magento deploy:mode:set production
    Please refer below articles for other commands and details of production/developer mode >> http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-mode.html >> http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-static-view.html

    7. To check Magento Module Status

    php bin/magento module:status

    8. For Static content deployment

    php bin/magento setup:static-content:deploy

  • How to install Magento 2

    This article gives you brief on how to install Magento 2 via Composer | Command line

    Just to note that i am installing Magento 2 on Ubuntu 14.04 LTS on xampp server

    PHP ver. 5.6 MySql ver. 5

    Step 1 : Setup/Install Composer.

    The first question comes into mind is what is Composer? I will answer this briefly...

    "Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you."

    To get in depth detail on Composer please visit this link https://getcomposer.org/doc/00-intro.md

    To install composer in your system, you will have to execute below command in terminal

    sudo wget -O /usr/local/bin/composer http://getcomposer.org/composer.phar
    Step 2 : Then make the composer file executable
    sudo chmod +x /usr/local/bin/composer
    Step 3 : Download Magento 2 from repository using composer.
    composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento2/
    NOTE: This above command will ask you for username and password of repository account, for this you will have to create account in magento connect and create secure key(username/password). The above command will download latest version of magento in magento2 directory. The above command will also ask you to save the authorization key(username/password of repository) in magento var directory, this may be helpfull for future magento upgrade, if you save the authorization key then this will not ask you for username/password during magento upgrades.

    Step 4 : Check PHP and path settings.

    it is assumed that you have already configured PHP to use as command line, but just in case you would like to check whehter your PHP is configured to use as command Line then execute below command in terminal

    php -v
    The above command will show the version of PHP install in your system.

    Step 5 : Installing Magento 2.

    All magento related command has to be executed from magento project root directory, in our case it is "magento2" directory.

    php -f bin/magento setup:install --base-url=http://localhost/magento2/ --db-host=localhost --db-name=dev_magento2 --db-user=dev_magento2 --db-password=S8s8RF2bnmWDSmxa --admin-firstname=Local --admin-lastname=Admin --admin-email=admin@example.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago
    OR
    php -f bin/magento setup:install --base-url=http://localhost/magento2/ --db-host=127.0.0.1 --db-name=dev_magento2 --db-user=dev_magento2 --db-password=S8s8RF2bnmWDSmxa --admin-firstname=Local --admin-lastname=Admin --admin-email=admin@example.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago
    Please make sure to change the values of below options in above commands as per your local set up >>

    --base-url --db-host --db-name --db-user --db-password --admin-firstname --admin-lastname --admin-email --admin-user --admin-password --language --currency --timezone

    NOTE: Once installation completes, it will give you magento admin url, you can save it OR you can get/change magento admin url from app/etc/env.php

    Step 6 : Installing sample data

    Below command will download sample data.

    php bin/magento sampledata:deploy
    Below command will install sample data
    php bin/magento setup:upgrade
    Once sample data installation completes it may give you a message – “Please re-run Magento compile command”, so please execute following command in terminal:
    php bin/magento setup:di:compile

    if you face any memory limit issue, then please run below commands for upgrade and compilation

    php -d memory_limit=-1 bin/magento setup:upgrade
    php -d memory_limit=-1 bin/magento setup:di:compile

    For any further details on installing Magento 2 please refer: http://devdocs.magento.com/guides/v2.0/install-gde/bk-install-guide.html

  • Solved: Magento 2 admin url gives error

    Solved: Magento 2 admin url gives error - Class Magento\Authorization\Model\RoleFactory does not exist

    This is most likely issue of var/generation directory, so apply below fixes, this may solve your admin login issue...

    1) Clear var/generation directory
    2) Check ownership and permission of var/generation directory

  • Solved: Magento 1.9.2.0 static block display issue

    While upgrading a Magento store version we found a bug in Magento 1.9.2.0 and here, we are giving a solution for this bug.

    Bug Description: While inserting two different CMS blocks in a page, Magento 1.9.2 displays static blocks sporadically which sometimes shows the wrong block rather than the correct one and sometimes displays the same block twice.

    Reason: The problem occurs due to generation of caching key info for CMS static blocks using the names rather thank block ID. Thus static blocks shares the same cache key and get mixed up in cache.

    If you want to reproduce the issue to better understand, perform following steps.

    * Create a static block with identifier “test_1? and content “This is test block 1? * Create a static block with identifier “test_2? and content “This is test block 2? * Edit the CMS home page. Using the widget selector, add “test_1? and “test_2? cms blocks * Enable cache.

    Expected Result: This is test block 1 This is test block 2

    Actual Result due to bug: This is test block 1 This is test block 1

    We have resolved this bug in Magento 1.9.2.0 and here is the solution explained.

    This happens due to the following code being added to the constructor of Mage_Cms_Block_Block: $this->setCacheTags(array(Mage_Cms_Model_Block::CACHE_TAG)); $this->setCacheLifetime(false);

    It adds cache functionality to static blocks. But cache key info is generated in Mage_Core_Block_Abstract, which use block name in layout. Block name does not exist since static block are not added though layout, and as a result they have the same cache key.

    Solution 1: To fix it we have created simple extension. It override Mage_Cms_Block_Block to generate correct cache key info for each static block based on store id, block id and secure connection.

    1. Create /app/etc/modules/NameSpace_Modulename.xml.
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      <?xml version="1.0"?>
      <config>
          <modules>
              <NameSpace_Modulename>
                  <active>true</active>
                  <codePool>local</codePool>
                  <depends>
                      <Mage_Cms/>
                  </depends>
              </NameSpace_Modulename>
          </modules>
      </config>
    2. Create /app/code/local/NameSpace/Modulename/etc/config.xml
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      <?xml version="1.0"?>
      <config>
          <modules>
              <NameSpace_Modulename>
                  <version>1.0.0</version>
              </NameSpace_Modulename>
          </modules>
          <global>
              <blocks>
                  <cms>
                      <rewrite>
                          <block>NameSpace_Modulename_Block_Block</block>
                          <widget_block>NameSpace_Modulename_Block_Widget_Block</widget_block>
                      </rewrite>
                  </cms>
              </blocks>
          </global>
      </config>
    3. Create /app/code/local/NameSpace/Modulename/Block/Block.php
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      <?php class NameSpace_Modulename_Block_Block extends Mage_Cms_Block_Block {
                 public function getCacheKeyInfo() {
                  if ($this->getBlockId())
                  {
                  return array(
                      Mage_Cms_Model_Block::CACHE_TAG,
                      Mage::app()->getStore()->getId(),
                      $this->getBlockId(),
                      (int) Mage::app()->getStore()->isCurrentlySecure()
                  );
              } else {
                  return parent::getCacheKeyInfo();
              }
            }
      }
    4. Create /app/code/local/NameSpace/Modulename/Block/Widget/Block.php
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      <?php class NameSpace_Modulename_Block_Widget_Block extends Mage_Cms_Block_Widget_Block {
      /** * Storage for used widgets * * @var array */
      static protected $_widgetUsageMap = array();
      /** * Prepare block text and determine whether block output enabled or not
      * Prevent blocks recursion if needed * * @return Mage_Cms_Block_Widget_Block */
              protected function _beforeToHtml() {
              parent::_beforeToHtml();
              $blockId = $this->getData('block_id');
              $blockHash = get_class($this) . $blockId;
              if (isset(self::$_widgetUsageMap[$blockHash])) {
                  return $this;
              }
              self::$_widgetUsageMap[$blockHash] = true;
              if ($blockId) {
                  $block = Mage::getModel('cms/block')
                      ->setStoreId(Mage::app()->getStore()->getId())
                      ->load($blockId);
                  if ($block->getIsActive()) {
                      /* @var $helper Mage_Cms_Helper_Data */
                      $helper = Mage::helper('cms');
                      $processor = $helper->getBlockTemplateProcessor();
                      $this->setText($processor->filter($block->getContent()));
                      $this->addModelTags($block);
                  }
              }
              unset(self::$_widgetUsageMap[$blockHash]);
              return $this;
          }
           /**
           * Retrieve values of properties that unambiguously identify unique content
           *
           * @return array
           */
          public function getCacheKeyInfo()
          {
              $result = parent::getCacheKeyInfo();
              $blockId = $this->getBlockId();
              if ($blockId) {
                  $result[] = $blockId;
             }
              return $result;
         }
      }
    5. Thats it. CMS static blocks issue solved.

    Solution 2: Temporary Fix Disable the Blocks HTML output cache and the blocks displayed are correctly.

    cachemanagement
  • Change admin routers after Installing Security Patch Supee 6788

    The latest Magento Security Patch, SUPEE-6788 is now available for Magento Community Edition 1.7 and later releases.

    Magento also released Magento Community Edition 1.9.2.2 and Magento Enterprise Edition 1.14.2.2 which includes SUPEE-6788.

    BACKWARD COMPATIBILITY

    This patch breaks backward compatibility in three ways that can affect extensions and customizations. For example, changes to admin routing can make extensions and customizations inaccessible from the admin panel if they are not using proper routing.

    To help address concerns about the admin routing changes, these changes in the patch are turned off by default. This means that the patch will include the fix, but that it will be disabled when installed.

    Need To Make Following Modifications In Custom modules For Making Compitible with the Magento patch SUPEE-6788

    1. \app\code\community\[NameSpace]\[Modulename]\etc\config.xml
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      <admin>
          <routers>
              <modulename>
                  <use>admin</use>
                      <args>
                          <module>NameSpace_Modulename</module>
                          <frontName>modulename</frontName>
                      </args>
              </modulename>
          </routers>
      </admin>

      Need to changed it to this:

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      <admin>
          <routers>
              <adminhtml>
                  <args>
                      <modules>
                          <modulename after="Mage_Adminhtml">NameSpace_Modulename_Adminhtml</modulename>
                      </modules>
                  </args>
              </adminhtml>
          </routers>       
      </admin>
    2. Need To Change Menu Action modulename/adminhtml_controllername/action To adminhtml/controllername/action.
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      <menu>
          <modulename translate="title" module="modulename">
              <title>Modulename</title>
                  <sort_order>10</sort_order>
              <children>
                  <modulename translate="title" module="modulename">
                      <title>Manage Item</title>
                      <sort_order>10</sort_order>
                      <action>modulename/adminhtml_controllername/action</action>
                  </modulename>
              </children>
          </modulename>
      </menu>

      Need to changed it to this:

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      <menu>
          <modulename translate="title" module="modulename">
              <title>Modulename</title>
                  <sort_order>10</sort_order>
              <children>
                  <modulename translate="title" module="modulename">
                      <title>Manage Item</title>
                      <sort_order>10</sort_order>
                      <action>adminhtml/controllername/action</action>
                  </modulename>
              </children>
          </modulename>
      </menu>
    3. Now Need to Modified your module layouts files. \app\design\adminhtml\default\default\layout\custommodule.xml
      1
      2
      3
      4
      5
      6
      7
      8
      <?xml version="1.0"?>
      <layout version="0.1.0">
          <modulename_adminhtml_controllername_action>
              <reference name="content">
                  ...
              </reference>
          </modulename_adminhtml_controllername_action>
      </layout>

      Need to changed it to this:

      1
      2
      3
      4
      5
      6
      7
      8
      <?xml version="1.0"?>
      <layout version="0.1.0">
          <adminhtml_controllername_action>
              <reference name="content">
                  ...
              </reference>
          </adminhtml_controllername_action>
      </layout>
    4. Plugin which Use Custom Block and Variables

    SUPEE-6788 Custom Blocks (and Variables) Issue
    Issue:

    • Some blocks are not shown on CMS pages, home page, category pages, landing pages in your Magento installation after installing SUPEE-6788 patch, page layout is broken.
    • Some transactional emails, order notification emails are broken, incomplete or have some data missing after installing SUPEE-6788 patch.

    Solutions:

    By default, only two blocks (core/template and catalog/product_new) are allowed for inclusion. So we need to add our extension’s custom block in blocks permission table.
    Upgrade your custom module’s sql script as follow.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    <?php $installer = $this; $installer->startSetup();
     
    if(in_array($this->getTable('permission_block'),$installer->getConnection()->listTables())){
    $installer->run("
        INSERT INTO {$this->getTable('permission_block')} (block_name,is_allowed) values ('custommodule/customblock','1');
        INSERT INTO {$this->getTable('permission_variable')} (variable_name,is_allowed) values ('custom_variable_name','1');
    ");
    }
    $installer->endSetup();
    ?>

    You can manually add custom block and custom variable values which we need to use in the CMS > Pages or CMS > Static Blocks or System > Transactional Emails.
    For Adding Custom block or Custom variable Go To System > Permissions > Blocks and Click On Add New block.

    1. Add block Name like “custommodule/customblock”.
    2. Set Is Allowed “Yes”.

8 Item(s)