Skip to main content

Posts

Showing posts from March, 2017

Maintenance mode

Sometimes we need to make update on live running site. We may have to update module, add new module or update changes. Updating the magento site can be risky when the site is running live. So, the solution is to temporarily put the site in maintenance mode and do the necessary changes. In magento, we can put the site in maintenance mode by adding the 'maintenance.flag' file at the root of the site. Now, when we browse the site, we will see the screen as shown below: We can also update the look and content of the above page. For that, we need to update the content of 503.phtml page found at 'errors/default/' folder at root. The header and footer template can be found at 'errors/default/page.phtml'. After we make the changes, we have to remove the maintenace.flag file from the root. Then the site will be live again.

Working out with blocks and layouts in magento 2

Page layout declares the wireframe of a page inside the <body> section, for example one-column layout or two-column layout. The allowed layout instructions are:  <container>  <referenceContainer>  <move>  <update> If we want to include a additional template file in home page, we can do it by adding the following layout update at cms design layout update section at admin. <referenceContainer name="footer">     <block class="Magento\Framework\View\Element\Template" name="nameofblock" template="Magento_Theme::template_name.phtml"/> </referenceContainer> Here we are including "template_name.phtml" at footer container section. The phtml template file should be under the templates folder of the module of our theme. Here the template is inside the module "Magento_Theme" under our theme. If we want to include the template from static blocks section at admin, add the

Magento webservice

Magento provides webservice with the ability to manage your eCommerce stores by providing calls for working with resources such as customers, categories, products, and sales orders. It also allows you to manage shopping carts and inventory. A SOAP v2 API version has been available since Magento 1.3, and a WS-I compliant version has been available since Magento 1.6. The Magento API supports SOAP and XML-RPC, where SOAP is the default protocol. With SOAP api, To connect to Magento SOAP web services, load the WSDL into your SOAP client from either of these URLs: http://hostname/api/soap/?wsdl where hostname  is the domain for your Magento host As of v1.3, you may also use the following URL to access the Magento API v2, which has been added to improve compatibility with Java and .NET: http://magentohost/api/v2_soap?wsdl=1 The following PHP example shows how to make SOAP calls to the Magento API v1: require_once('app/Mage.php'); Mage::app(); try { $client = n

Suspected Fraud orders in magento

Magento orders paid via paypal, eway or any other payment gateway, sometimes mark the orders as Suspected Fraud. The Suspected Fraud status is assigned to state "Payment Review". This means the order doesnot have invoice issued and the confirmation email is also not sent. We cannot create the invoice for it either. The Suspected Fraud status is assigned to order because of exchange rates or tax rounding. For example, the amount of money which Paypal charges the customer is out by 1p compared to the amount of money that Magento thinks should have been charged. When Paypal tells Magento that the order has been paid and how much money has been paid, Magento sees this difference and marks it as Suspected Fraud. The solution is to update the state of the Suspected Fraud status to "processing" instead of "payment review". For this, go to magento admin panel and to System -> Order Statuses section. There you can see the list of Order Statuses and the S