How to count sale product in Magento 1

– If you want to show stock sold on the product page for the entire duration the product has been active, try this code:

– If you want to how many have been sold of the product for today, try this code:

– If you want to have it so that it only […]

Read More >

How to call static block any page in Magento 2

– If you want to call static block in cms page:

– If you want to call in phtml file :

– Your xml file code should be :

Read More >

[Solved] add product in cart using ajax in Magento 2

If you want to add product in minicart Magento 2 with Ajax, follow below way: – Open addtocart.phtml file in your theme directory: app/design/frontend///Magento_Catalog/templates/product/view – Modify the bindSubmit function

Read More >

How to clear items in cart magento 1&2

Magento 1 : The code for delete shopping cart items for logged in customer:

The code for delete shopping cart items for all customers:

If you have a large number of customers quotes then deleting them by using loop might be time and resource consuming. You can clear/delete all customers cart items (all […]

Read More >

How to install Magento 2 via Archive file, Composer or GitHub

When installing Magento 2 on your machine you should ask yourself: Do I need more problems in my life? If the answer is Yes, continue reading. I’ll be installing Magento 2 on my dev machine – Linux Ubuntu 16.04 with Php 7.0.7 Mysql 5.7.12 Composer 1.1.2 Before continuing, make sure you have all the prerequisites, required […]

Read More >

Magento : Get Base Url , Skin Url , Media Url , Js Url , Store Url and Current Url

MAGENTO 1 : Get Url in phtml files

Get Url in cms pages or static blocks

MAGENTO 2 : Below is a block class of my custom module. I have injected object of StoreManagerInterface & UrlInterface in the constructor of my module’s block class. Both of them can be used to fetch base and current URL. In […]

Read More >