Posts in Category: magento2

Magento 2 admin recreate cart

Magento 2 admin recreate cart

To restore quote or magento 2 admin recreate cart pro-grammatically we need to use admin session model, frontend magento checkout model will not be useful here. The sample code was given below,

Model

namespace Yournamespace\Yourmodulename\Model\Adminhtml\Order;

class RecreateOrder
{
    public function __construct(
    										
					

Read More

magento 2 custom payment method

custom payment method Magento 2

In this article we explain about creating new custom payment method in magento 2 from the new custom module. The payment module details are
Namespace – Explorer
Module – Payment
Payment – Testpay

To register the module in magento 2 use registration.php and module.xml file with having the module name there.

Read More

Magento 2 get currency symbol

Magento 2 get currency symbol by code

Magento 2 get currency symbol using code can be we do from Magento currency Interface. In default, magento will give all currency from configuring admin. To set the configuration see here.In frontend all the allowed currencies are displayed. So we can get the current currency code directly from

Read More

Magento2 code snippets

Magento2 code snippets

This articles gives some useful Magento2 code snippets. To know more about magento2 click here.

Order state update

To update the order state and and status pro-grammatically in order define the status and state in this format. Initiate order object in the construct function

Read More

Magento 2 setup script

Magento 2 setup script

Magento 2 Setup script is a installer script to create a database table from the module. However this is already known from magento 1.x the coding structure vary in the magento 2.x. In magento 1.x these sql scripts are written in mysql4-install-{module version number}.php. In magento 2 these sql code

Read More

Magento2 Controller

Magento2 controller dispatch

In MVC type frameworks controllers are very important to handle the incoming request and sending response. In this article we are going to see the magento2 controller dispatch in detail. As we all know normally in magento 1.x to execute any controller in modules we need the following

Read More