Monday 13 March 2017

error setting certificate verify locations: CAfile: D:\xampp\php\cacert.pem CApath: none

Follow these steps to solve this error.


1 Download :[https://gist.github.com/VersatilityWerks/5719158/download]

2 Extract it and place it in C:\xampp\php\

3 Open the file C:\xampp\php\php.ini

4 Insert the following line in the bottom curl.cainfo="C:\xampp\php\cacert.pem"of the file, if curl.cainfo does not exist already (then you should replace the line). 

Saturday 17 December 2016

Contact us page

There are two ways to create contact us page.

Step1. Create a CMS page named contact us

Type the contact details as we are doing normal.
Now we want to add contact form. Add the below code.

{{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}}

Example is below
<div style="width:30%; float:left;margin-right:10px;">
    xxx.xxx.xxx.xxxx.xxxx.
    xxx.xxx.xxx.xxxx.xxxxx.
    Ahmedabad-382440, Gujarat, INDIA
</div>
<div style="float:left;">
    {{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}}
</div>


*************************************************************

Step2: Open vendor/magento/module-contact/view/frontend/templates/form.phtml
And make the changes as you desire.



Friday 16 December 2016

How to optimise magento2 site?

To merge and minify JavaScript and CSS files on Magento 2, follow these steps:

    Log in to Magento using your administrator account.

  1.    On the left sidebar, click STORES, and then under Settings, click Configuration.
  2.    Cilck ADVANCED, and then click Developer.
  3.    Click JavaScript Settings, and then in the Merge JavaScript Files list box, select Yes.
  4.    In the Minify JavaScript Files list box, select Yes.
  5.    Click CSS Settings, and then in the Merge CSS Files list box, select Yes.
  6.    In the Minify CSS Files list box, select Yes.
  7.    Click Save Config.

Maintenance mode

How to check the status of maintence mode
Run: php bin/magento maintenance:status


To enable maintenance mode, type the following command:
Run: php bin/magento maintenance:enable


To disable maintenance mode, type the following command:
Run: php bin/magento maintenance:disable


How to allow access to the front-end store from a specific IP address
Run: php bin/magento maintenance:allow-ips 192.168.1.35

For more infomation read the below link.

https://www.a2hosting.com/kb/installable-applications/optimization-and-configuration/magento1/enabling-magento-maintenance-mode

How to add custom page in menu bar in magento2?

<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php
/**
 * Top menu for store
 *
 * @var $block \Magento\Theme\Block\Html\Topmenu
 */
?>
<?php $columnsLimit = $block->getColumnsLimit() ?: 0; ?>
<?php $_menu = $block->getHtml('level-top', 'submenu', $columnsLimit) ?>

<?php $pageurl = $this->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true]);?>
<?php $x =  explode("/",$this->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true])); $x[4]; ?>

<nav class="navigation" data-action="navigation">
    <ul data-mage-init='{"menu":{"responsive":true, "expanded":true, "position":{"my":"left top","at":"left bottom"}}}'>
   
        <li class="level0 nav-0 first <?php if($x[4]=="") { echo "active"; }?> level-top ui-menu-item" role="presentation">
            <a href="<?php echo $block->getUrl();?>" class="level-top ui-corner-all" id="ui-id-3" tabindex="-1" role="menuitem">
            <span>Home</span></a>               
        </li>
       
        <li class="level0 nav-1 last <?php if($x[4]=="about-us") { echo "active"; }?> level-top ui-menu-item" role="presentation">
        <a href="<?php echo $block->getUrl();?>about-us" class="level-top ui-corner-all" id="ui-id-3" tabindex="-1" role="menuitem">
        <span>About us</span></a>
       
        <?php /* @escapeNotVerified */ echo $_menu; ?>
        <?php /* @escapeNotVerified */ echo $block->getChildHtml(); ?>

        <li class="level0 nav-5 last <?php if($x[4]=="contact-us") { echo "active"; }?> level-top ui-menu-item" role="presentation">
        <a href="<?php echo $block->getUrl();?>contact-us" class="level-top ui-corner-all" id="ui-id-3" tabindex="-1" role="menuitem">
        <span>Contact us</span></a>
       
        </li>

    </ul>
</nav>

Monday 21 November 2016

Images and js are not seen or loaded after magento2 installation.

Follow this one.

Remove entire files and folder under pub/static except .htaccess file.

Open up app/etc/di.xml find the path "Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink" and replace to Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

After completing image and js will be seen and loaded.








Thursday 16 June 2016

Important Notes

To increase the memory.
To increase the memory in magento. If you are getting error of memory or time limit. Write the below line in that file.

ini_set('memory_limit', -1);

***********************************************************************************

Facebook connect by belvg
In facebook connect plugin, there is an error, after i run the setup:upgrade.

The solution i got from somewhere is that add below code in system.xml file.
<tab id="belvg">
            <label>Vendor Name</label>
</tab>

The result will be like this.
<system>
        <tab id="belvg">
            <label>Vendor Name</label>
        </tab>
 ***********************************************************************************