Ask your Question

Write to us !

Ask Question !

Show error message when adding a product of price 0.

To restrict products having price zero from shopping we need to create a observer on
checkout_cart_product_add_after event such that on every add to cart it will check the
product price and then add to cart.

Create a module and in etc/config.xml define the observer under event node.

Here Our module name is zeroprice under Letsknowit namespace.

File path : app/code/local/Letsknowit/zeroprice/etc/config.xml

Read More

Admin and Frontend icon fonts missing after installing Magento2.O

Admin and Frontend icon fonts missing after installing Magento2.O

 

1. Open file app/etc/di.xml in and editor

2. find the line MagentoFrameworkAppViewAssetMaterializationStrategySymlink 
 and replace it with  MagentoFrameworkAppViewAssetMaterializationStrategyCopy line.
 
3. Go to folder pub/static and remove all files and folders except .htacess file.
&am... Read More

How to delete a product in Magento2 Programatically

How to delete a product in Magento2 Programatically

 To delete a product from frontend 

1. On delete icon/link we need to pass the product ID which we need to delete.
2. We need to create a  controller class to execute the delete process and
  need to write the delete code under execute method of class.
 
 class Deleteproduct Read More

Magento Events and Observers

 To separate your custom code from the core code we use event driven programming where an event is fired and an observer is listening for specific events and executing certain logics on specific event. These events have certain class objects attached as function parameter .Observers (Class functions) runs when the event is fired and receive the cla... Read More

Export list of products that have no category in magento

To get the list products have no category we need to retrieve the product collection and then filter the result with category check , filtered result will make to export in csv format. 

<?php

ob_end_clean();

require_once('app/Mage.php');

umask(0);
Mage::app();
Read More