How to enable Category Permissions feature in Magento Commerce?

Magento Commerce Category Permissions feature comes with disabled but if you want to enable the category permission feature you can do it using the command line only.

For security reasons, this field will be not editable from the admin panel.

You can see the category permission feature from, Continue reading “How to enable Category Permissions feature in Magento Commerce?”

How to Reindex prices by product ids programmatically Magento 2?

You can reindex only prices for the products in Magento 2 store by their ids.

Indexer id used for the prices is catalog_product_price. We need to reindex only prices programmatically to reflect the price changes on the backend. you can do it using CLI command also,
php bin/magento indexer:reindex catalog_product_price Continue reading “How to Reindex prices by product ids programmatically Magento 2?”

Error during compilation, Incompatible argument type: Required type: \Magento\Framework\DB\Adapter\AdapterInterface.

We can be resolved Compile time error by below way, The error looks like when running compilation command,

Incompatible argument type: Required type: \Magento\Framework\DB\Adapter\AdapterInterface. Actual type: string; File:
app/code/Rbj/CustomForm/Model/ResourceModel/Customform/Grid/Collection.php
[Magento\Framework\Validator\Exception]
Error during compilation

Solutions:

From Magento 2.2.* version we need to pass full class name in__construct()  instead of $connection = null as di argument in Collection.php file.

Replace, $connection = null argument with \Magento\Framework\DB\Adapter\AdapterInterface $connection = null  in __construct() parameter.

Run again command,
php bin/magento setup:di:compile
an error will be gone.