Skip to main content

Posts

Latest order is not showing in admin sales order grid in magento1

Refresh order grid table in Magento 1 Latest order is not showing in admin grid, but it is saving in database and also showing order id in mail. Recently, we’ve faced a data inconsistency in the Magento sales_flat_order_grid db table. I’ve developed a shell-script, which will refresh the sales_flat_order_grid table to correspond exactly to the sales_flat_order table: create file in shell folder orders_grid_update.php place the below code <?php /**  * @author Pawan  * @copyright Copyright (c) 2018 pawan (https://pawanmagento.blogspot.com/)  * @package Pawan_Shell  */ require_once 'abstract.php'; class Pawan_Shell_Free_Order_Grid_Update extends Mage_Shell_Abstract {     public function run()     {         try {             Mage::getModel('sales/order')->getResource()->updateGridRecords(                 Mage::getResourceModel('sal...

Magento 2 Adding Total Due and Total Paid to PDF order

Hi I am trying to add total paid and total due lines on my Magento PDF Invoice. Firstly you have to create pdf.xml at path : app\code\Pawan\PdfCustomiser\etc   <?xml version="1.0"?>    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/pdf_file.xsd">       <totals>          <total name="total_due">             <title translate="true">Total Due</title>             <source_field>total_due</source_field>             <model>Pawan\PdfCustomiser\Model\Sales\Pdf\Totaldue</model>             <font_size>7</font_size>             <display_zero>false</display_zero>             <sort_orde...

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...

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::throwExcept...

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 header...