How to override cron job group in Magento 2?

You can see your existing cron Group name from your module crontab.xml file.

Override the Module Cron Job group from default to custom group easily. Also, you can change the cron schedule time.

If you want to override any existing Crom Job that contains a default Group, You can change it to your custom group by creating a simple module. Continue reading “How to override cron job group in Magento 2?”

Circle Ci pipeline deployment Failed with error Execute “deploy:unlock” task to unlock.

While you are deploying your code with the Circle ci pipeline and if your deployment is stuck without deployment success and if the error will be thrown like this,

Deploy locked by ci.
Execute “deploy:unlock” task to unlock

You can fix this issue by manually deleting deploy.lock from your server.

In my case, It was a Sonassi server and You have to go SSH with your project root,

project_root_domain/___deploy/.dep/deploy.lock

Just Delete the deploy.lock file from here and start deployment again to fix the issue.

Whenever a deployment starts it creates a lock file to naturally stop against multiple deploys being done since a deployment can touch the database. You need to manually remove this file to run the deployment again.

When Deployment started, https://github.com/deployphp/deployer/blob/master/recipe/common.php#L137 It can already lock the current deployment before the release is completed.

How to get custom image type attribute value from product magento 2?

We can able to fetch the Custom Image Type product attribute value from the Product object by just fetching the product object.

Let’s say you have created a custom image_type product attribute called, brand_logo and you want to fetch the value saved for a product by product object. You can refer to the below logic to fetch the image value.

You can fetch the value of the image attribute by calling the below line,

I hope you have fetched the Product Object by the ProductRepositoryInterface, You can check the logic, Fetch Product Object By SKU

$product->getData('brand_logo');

Using the above stuff, You will get the file path of the image in the response.