How to Add/Update Special price of Product Magento 2?

You can Add or Update special price of the product by the SpecialPrice Interface. Catalog module contains the Special Price interface to update the special price of the product.

Base defination of the update special price of the product,
public function update(array $prices); Continue reading “How to Add/Update Special price of Product Magento 2?”

How to get Special price collection by Product SKU in Magento 2?

Get Special Price data by Product SKU in Magento 2. Special price is the price, which offers discount/sale to the original price.

You need to use interface,
Magento\Catalog\Api\SpecialPriceInterface to retrieve special price collection with price_from, price_to, store_id and sku. Continue reading “How to get Special price collection by Product SKU in Magento 2?”

How to Check html minify enable programmatically Magento 2?

Magento 2 has native feature to enable html Minify from the Configuration setting in the admin panel.

Html Minification is not applied in developer mode.

To Minify html in Magento 2 via admin panel,
Go To Admin panel,
Click Stores -> Settings -> Configuration,
Select Advanced -> Developer Tab,
Open Template Settings section,
Html minify set to Yes,
Click on Save Config. Continue reading “How to Check html minify enable programmatically Magento 2?”