Skip to main content

Posts

magento 1 extension converted in to magento 2 process

Simple Install =================================== Download as a zip below link. unzip and upload it to your public_html or other rootdoc directory. https://github.com/magento/code-migration. login to your server via shell switch to the code-migration-develop directory by running following command   cd code-migration-develop Run command following command in root directory of this toolkit composer instal Before running the migration, the following directories need to be prepared: ===================================== * `<src>` - Directory that contains custom Magento 1.x code that is intended to be migrated. The code must follow the Magento 1.x directory structure.   Magento1.x core files must not be included. * `<dst>` - Empty directory for the toolkit to put the generated Magento 2 code to * `<m1>` - Directory that contains: * Vanilla Magento 1.x codebase, and * Custom Magento 1.x code same as in `<src>` d

Implement Product Schema.org Markup into Magento

In this tutorial we’ll be looking at how we can add all the main features of Product Schema into your Magento template files – editing the files and then testing it through Google’s own structured data testing tool. As mentioned in my Magento SEO book, we add product schema into our Magento websites in order for search engines such as Google to be able to identify the main purpose of our page – in this case the main attributes of our product. The main benefits of adding product schema markup to our pages is for search engines to be able to read them more easily and present ‘rich snippets’ in their own results pages based on the information they find. These ‘rich snippets’ typically display our product price or price-range and any aggregated reviews that our product may have accumulated. Although not a ranking factor in itself they do present the user with a ‘juicier’ search result – giving your listing a bit of an edge over the competition (those not displayed with rich snippets

Redirecting functions in magento frontend controller

There are three redirecting functions available in frontend controller which are: redirect() _redirectUrl() _redirectReferer() _redirect('frontName/controllerName/actionName/param1/param2') is used for internal redirection. _redirectUrl($fullUrl) is used for external redirection. _redirectReferer() is used to redirect to the referer url.

Limit the size of a product image upload (dimensions) set default limits

If you  trying to change default uploading image sizes like minimum size accept is 500x500 and the maximum size allowed is 1000x1000 . Need to check validations open the file in your magento folder  app\code\core\Mage\Catalog\Helper\Image.php and search for  below function public function validateUploadFile($filePath) { around the 636 line public function validateUploadFile($filePath) {             $maxDimension = Mage::getStoreConfig(self::XML_NODE_PRODUCT_MAX_DIMENSION);             $imageInfo = getimagesize($filePath);             if (!$imageInfo) {                 Mage::throwException($this->__('Disallowed file type.'));            }         if ($imageInfo[0] > $maxDimension || $imageInfo[1] > $maxDimension) {             Mage::throwException($this->__('Disalollowed file format.'));         }         $_processor = new Varien_Image($filePath);         return $_processor->getMimeType() !== null;     } Change to public function vali

Magento Debug HEADERS ALREADY SENT error

When you  receiving the following error in  system.log file: app\code\core\Mage\Core\Controller\Response\Http.php:44  [1] \www.pawan.com\lib\Zend\Controller\Response\Abstract.php:727  [2]  \www.pawan.com\app\code\core\Mage\Core\Controller\Response\Http.php:75  [3]  \www.pawan.com\app\code\core\Mage\Core\Controller\Varien\Front.php:188  [4]  \www.pawan.com\app\code\core\Mage\Core\Model\App.php:304  [5]  \www.pawan.com\app\Mage.php:596  [6]  \www.pawan.com\index.php:81 if you have no idea what file is causing this. Here is the steps to debug. That error is thrown from Mage_Core_Controller_Response_Http -> sendHeaders(). This function calls the super class function that actually does the check to see whether or not headers have already been sent, Zend_Controller_Response_Abstract -> canSendHeaders(). The Zend_Controller_Response_Abstract class handles, among other things, sending response headers and tracking the last time the headers were sent (and from wha

magento 2 best seller product display based on current category and subcategories

Magento 2 getting best seller based on category wise displaying i have done below for that to implement this functionality it is working fine for me. step 1 create block file in our module folder <?php namespace Pawan\Bestseller\Block; use Magento\Catalog\Api\CategoryRepositoryInterface; class Bestsellercategory extends \Magento\Catalog\Block\Product\ListProduct {     /**      * Product collection model      *      * @var Magento\Catalog\Model\Resource\Product\Collection      */     protected $_collection;     /**      * Product collection model      *      * @var Magento\Catalog\Model\Resource\Product\Collection      */     protected $_productCollection;     /**      * Image helper      *      * @var Magento\Catalog\Helper\Image      */     protected $_imageHelper;     /**      * Catalog Layer      *      * @var \Magento\Catalog\Model\Layer\Resolver      */     protected $_catalogLayer;     /**      * @var \Magento\Framework\Data\Helper\PostHe

Magento multiple order on one checkout or order splitting(Vendor wise order splitting)

I had to split orders based on the vendor/seller selling that product. Like, for example, if someone orders Product1, Product2 and Product3, where Product1 and Product2 are sold by Vendor1 and Product3 is sold by Vendor2. Then, 2 orders with different Order Ids must be created where the Order1 will have details regarding the order of Product1 and Product2 and the Order2 will have the details regarding the order of Product3. I changed the saveOrder() function. It now splits the order by fallowing ways. 1.Create config file or you can use existing module configfile. <?xml version="1.0"?> <config>     <modules>         <Pawan_Splitorder>             <version>0.1.0</version>         </Pawan_Splitorder>     </modules>     <global>         <helpers>             <splitorder>                 <class>Pawan_Splitorder_Helper</class>             </splitorder>         </helpers&