Magento 2: Get Product Stock Quantity and Other Stock Information

This article shows how to get stock quantity (qty) of a product in Magento 2. We can also fetch other stock information like minimum quantity (min_qty), minimum sale quantity (min_sale_qty), maximum sale quantity (max_sale_qty), see if a product is in stock (is_in_stock), etc. We will be using Magento 2’s Service Layer for this task. Use … Read more

Magento: How to get product stock quantity & other stock information?

Here is a quick code to get any product’s stock information like quantity (qty), minimum quantity (min_qty), stock availability (is_in_stock), minimum and maximum sale quantity (min_sale_qty and max_sale_qty), etc. First load the product. Product can be loaded in different ways. Here are the two different ways to load any product in Magento:- 1. Load product … Read more

PHP: How to get stock quote data from Yahoo! Finance? (Complete Code and Tutorial)

In this tutorial, I will be showing you how you can fetch any company’s data from Yahoo! Finance. INTRODUCTION First of all, let us see the stock quote data of top tech companies on Yahoo! Finance. View the basic Google stock chart on Yahoo! Finance: http://finance.yahoo.com/q?s=goog For eBay: http://finance.yahoo.com/q?s=EBAY For Amazon: http://finance.yahoo.com/q?s=AMZN For Apple: http://finance.yahoo.com/q?s=AAPL … Read more

Magento: How to enable backorders?

Difference between backorder and pre-order A backorder is for an item that was in stock previously but is temporarily out of stock. A pre-order is for an item that has not been released yet. Scenario for backorder: For example, a customer orders 3 items. One item is not in stock. Shouldn’t I be able to … Read more