Create Database, Create Database User and Set Database Privileges for particular User Using SSH

In this post We’ll let you know how to Create Database using SSH, how to Create Database User using SSH and also how to Grant or Revoke Privileges for a particular user using SSH. To perform database opration using SSH…

Read More

Magento 2 Get file URL of the static content folder in Controller

<?php class … protected $_assetRepo; public function __construct( …. MagentoFrameworkViewAssetRepository $assetRepo, …. ) { …. $this->_assetRepo = $assetRepo; …. } Now, In you case module name is : Company_Helloworld and you want icon.png from images directory so  echo $this->_assetRepo->getUrl(“Company_Helloworld::images/icon.png”); Hope…

Read More

Rest Api Get / Update Order Custom Field for Woocommerce

You can extend the Rest API response with some code like: add_action( ‘rest_api_init’, ‘your_custom_register_api_fields’ ); function your_custom_register_api_fields() {         register_rest_field( ‘shop_order’,’your_custom_field‘,         array(             ‘get_callback’    => ‘your_custom_api_meta_callback’,        …

Read More