26 10, 2015

Magento 2: Display image using static block

October 26th, 2015|MAGENTO, MAGENTO 2|0 Comments

In Magento 1 we used the {{media url=””}} to display the image in frontend. But now how to display in Magento 2.

Let’s Start

1. Put the image in the path app/design/frontend/{Vendor Name}/{Theme name}/web/images

2. In static block or cms page content write

{{view url="images/image-1.jpg"}}

now check the page or […]

15 10, 2015

Magento 2: Get url in template file

October 15th, 2015|MAGENTO, MAGENTO 2|0 Comments

In Magento 1, we can directly get the image url using Mage::getUrl() function.

But in Magento 2 there are some changes to call the images

Use this code to phtml file to get the Url

<?php echo $block->getUrl('call/index/view') ?>

Here:

call:- Module frontname
index:- Controller name
view:- Action name

Now Refresh the page and […]

15 10, 2015

Magento 2: Get image url in template file

October 15th, 2015|MAGENTO, MAGENTO 2|0 Comments

In Magento 1, we can directly get the image url using $this->getSkinUrl() function.

But in Magento 2 there are some changes to call the images

1. Put the image on this path app/code/Webmull/Call/view/frontend/web/images

2. Use this code to phtml file to call the image

<img src="<?php echo $block->getViewFileUrl('Webmull_Call::images/call_img.png'); ?>" alt="<?php [...]

30 09, 2015

Magento 2: Add new Custom Form Validation

September 30th, 2015|MAGENTO, MAGENTO 2|3 Comments

In Magento 1, There was one file validation.js. We can add the new validation on that file or also add in our extension .phtml or .js file.

In Magento 2, We can add our custom validation in .phtml file. It is very good news for us Magento 2 is not using […]

30 09, 2015

Magento 2: Override the Magento Template

September 30th, 2015|MAGENTO, MAGENTO 2|2 Comments

In Magento 1,It is very easy to override the Template. We are directly add the the code in .xml file. Now You think What happen in Magento 2.

So Don’t worry.

We can also do this thing in Magento 2,

Let’s see how we can do this.

1) Copy the .xml file in the […]

18 09, 2015

Magento 2: set the custom product price

September 18th, 2015|MAGENTO, MAGENTO 2|0 Comments

Same as Magento 1 , it is possible to set the custom product price. We can use same event we used in magento 1. But file structures are different, so we need to use some structure to use event observer.

Let’s see the file structure

app/code/Webmull/Customprice/etc/

app/code/Webmull/Customprice/etc/frontend/

app/code/Webmull/Customprice/Observer/

 

1. We create the module configuration price […]

15 09, 2015

Magento 2: Change the image size in listing page

September 15th, 2015|MAGENTO, MAGENTO 2|0 Comments

In Magento 1, To change the image size we have to change in every listing page. So we have to remember all the file list and search on whole site.

In Magento 2, We have good news to resize the image. We do not need to remember all the file. All […]

5 09, 2015

Magento 2: Change the Database Detail

September 5th, 2015|MAGENTO, MAGENTO 2|0 Comments

In magento 1, To change the database detail we directly change in the local.xml file.

Now you are thinking what will be do in Magento 2. Don’t worry it is easy same as Magento 1. But File is different to change the Database Detail. We can also change the table prefix […]

5 09, 2015

Magento 2: Change Admin url

September 5th, 2015|MAGENTO, MAGENTO 2|2 Comments

In magento 1, To change the admin url we directly change in the local.xml file.

Now you are thinking what will be do in Magento 2. Don’t worry it is easy same as Magento 1. But File is different to change the admin url.

To change the url open the file env.php […]

5 09, 2015

Magento 2: Create Custom Structure Layout

September 5th, 2015|MAGENTO, MAGENTO 2|0 Comments

By default, Magento is providing structure Layout like , empty, 1 column, 2 column-left, 2 column-right, 3 columns. Sometime when we implement the design we need to create new structure layout and set the design as per our theme.
Let’s How to create custom structure layout

1) We need to create layout.xml […]