Page 50 of 68

Magento 2 – How to Get Product Stock Quantity, Min Quantity and Other Stock Information

In this post I am going to explain how to load product stock quantity, min quantity and other stock information in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_stockItemRepository; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\CatalogInventory\Model\Stock\StockItemRepository $stockItemRepository, array $data = [] ) { $this->_stockItemRepository = $stockItemRepository; parent::__construct($context, $data); }…

Magento 2 – How to Get Product by SKU

In this post I am going to explain how to load product by SKU in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_productRepository; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\ProductRepository $productRepository, array $data = [] ) { $this->_productRepository = $productRepository; parent::__construct($context, $data); } public function getProductBySku($productSku) { return $this->_productRepository->get($productSku);…

Magento 2 – How to Get Product by ID

In this post I am going to explain how to load product by ID in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_productRepository; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\ProductRepository $productRepository, array $data = [] ) { $this->_productRepository = $productRepository; parent::__construct($context, $data); } public function getProductById($productId) { return $this->_productRepository->getById($productId);…

PrestaShop Checkout – An innovative payment solution built with PayPal

Recently, PrestaShop and PayPal has launched a brand new simplified payment solution called as PrestaShop Checkout to provide the best checkout experience to PrestaShop e-shops! PrestaShop’s partnership with PayPal allows merchants to manage all cashing processes for their store on one single interface. There’s no denying that when it comes to accepting and receiving payments…

How to show cover image of your product with combination in PrestaShop 1.7?

In e-Commerce business, Product image is a vital aspect, to attract a visitor’s eye in the first place. In PrestaShop 1.7, If you have combination product then PrestaShop shows image of the one selected by default in product combination instead of the generic (Cover) image of your product. Do you want to show generic (Cover)…

Magento 2 – How to Get Product Reviews Collection with Rating

In this post I am going to explain how to get product reviews with rating in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_reviewCollectionFactory; protected $_storeManager; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Review\Model\ResourceModel\Review\CollectionFactory $reviewCollectionFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, array $data = [] ) { $this->_reviewCollectionFactory = $reviewCollectionFactory; $this->_storeManager = $storeManager; parent::__construct($context,…

Magento 2 – How to Get Product Collection

In this post I am going to explain how to get list of all products or you can say product collection in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_productCollectionFactory; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory, array $data = [] ) { $this->_productCollectionFactory = $productCollectionFactory; parent::__construct($context, $data);…

Magento 2 – How to Get Order Collection

In this post I am going to explain how to get list of all orders or you can say order collection in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_orderCollectionFactory; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory, array $data = [] ) { $this->_orderCollectionFactory = $orderCollectionFactory; parent::__construct($context, $data);…

Magento 2 – How to Get List of All Customers

In this post I am going to explain how to get list of all customers or you can say customer collection in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_customerFactory; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Customer\Model\CustomerFactory $customerFactory, array $data = [] ) { $this->_customerFactory = $customerFactory; parent::__construct($context, $data);…

« Older posts Newer posts »