How to set stores URL configuration by env.php file in magento 2?

Magento env.php file stores  Environment specific configuration and system-related sensitive data.

With the help of the ‘system’ array node, A System node locks the provided configuration values in the env.php file and disables that field in the admin panel.

Sensitive values might be API keys for the connector, Payment related Stuff, Email Addresses, URLs, and Private Contact related information.

We will set the URL value with the env.php file.

You can’t able to modify it from the Stores -> Configuration -> General -> Web -> Base URL field. Continue reading “How to set stores URL configuration by env.php file in magento 2?”

Magento 2 Update Product Stock Inventory by Rest API.

You can Update Product Stock related information by REST API with the use of endpoint URL /V1/products/:productSku/stockItems/:itemId.

You can manage Stock Inventory related data with REST API with the given payload as below.

Action: PUT

Header: Authorization: Bearer <ADMIN_TOKEN> Continue reading “Magento 2 Update Product Stock Inventory by Rest API.”

How to do reset columns from collection Query by magento 2?

You can reset columns from the given collection in Magento.

Many times you want to be sure of the better performance for a given query and you want to reset a specific collection by fetching a few of the columns in the result.

Magento Collection provides the reset() method to clear specific part from the sql query. Continue reading “How to do reset columns from collection Query by magento 2?”