Magento2 – How to load Quote by Quote id 0 (0)

Magento2 – How to load Quote by Quote id 0 (0)

Use \Magento\Quote\Api\CartRepositoryInterface Repository as a dependency to create its instance and load the quote using id. Alternatively you can also get quote using \Magento\Quote\Model\QuoteFactory model. But this has

Magento2 – How to get store information 0 (0)

Magento2 – How to get store information 0 (0)

By default store manager loads current store information. You can get store information by `store_id` parameter. You must create an instance of \Magento\Store\Model\StoreManagerInterface class to get store information.

Magento2 – How to get Current Url 0 (0)

Magento2 – How to get Current Url 0 (0)

To get url of the current page, the code below works everywhere: $objectManagerInstance = \Magento\Framework\App\ObjectManager::getInstance(); $url = objectManagerInstance -> get('Magento\Framework\UrlInterface'); echo $url -> getCurrentUrl(); From a .phtml template

Magento2 – How to get Directory of a Module 5 (2)

Magento2 – How to get Directory of a Module 5 (2)

Here is the code how to load your module directory:

Magento2 – How to get Current locale Programmatically 0 (0)

Magento2 – How to get Current locale Programmatically 0 (0)

Inject Resolver Dependency and get locale in your phtml And in your phtml:

Magento2 – How to Get Country Name Using Country Code 0 (0)

Magento2 – How to Get Country Name Using Country Code 0 (0)

Create Instance to Object Manager then inject dependency to perform your query: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); Now load your country by the following code: While AE is the country

Magento2 How to Get Country Code Collection 0 (0)

Magento2 How to Get Country Code Collection 0 (0)

To get country list data, you need to create instance of Country collection model `Magento\Directory\Model\ResourceModel\Country\CollectionFactory`. Once instance is created, you can load it by current store.

Magento Load Product By Id 0 (0)

Magento Load Product By Id 0 (0)

To load product by id, use the load($id) function by providing product id as parameter following the Product Model Class Mage_Catalog_Product_Model. A single product with object array will

Magento Get Product Data Programmatically 0 (0)

Magento Get Product Data Programmatically 0 (0)

To retrieve product data programmatically, we will use resource model to get product collection. Resource Models contains the collection query directly with database to behalf of the model.

Magento Formating Price 0 (0)

Magento Formating Price 0 (0)

Magento provides build-in method to support the price formatting accordingly. There are the couple of methods in magento to format price. The method below is easiest to get

Magento get base url, skin url, media url, store url 0 (0)

Magento get base url, skin url, media url, store url 0 (0)

1. Path Retrieval in Static Block or CMS Page Get Base Url: Get Store Url: Get Media Url: Get Skin Url:   2. Path Retrieval in phtml files

Magento How to create Custom Admin User with limited permissions 0 (0)

Magento How to create Custom Admin User with limited permissions 0 (0)

There are the times when we need few admin roles bounded under specific permissions. So Today I am showing you how to create another admin with custom roles.