How to check is database table exists or not by Magento 2?

You can verify the given database table available in the database with the help of isTableExists() method by use of Magento\Framework\App\ResourceConnection class.

This method is useful when you are dealing with a database query and want to run your query on the safe side to check whether the first given table exists or not before firing the SQL query. Continue reading “How to check is database table exists or not by Magento 2?”

How to fix Magento custom patch throws an error while patch applied?

Magento applies a custom patch with a command line, composer -v install throws an error,

[TypeError]                                                                                                                 
  Composer\Util\RemoteFilesystem::copy(): Argument #1 ($originUrl) must be of type string, null given, called in /var/www/ht  
  ml/vendor/cweagans/composer-patches/src/Patches.php on line 388    
  
          "Patch Call to a member function getCustomer() on null fix": "patches/vendor/rbj/module-customer-feature/Model/Rule/Condition/Customer.patch" IN the class name typo issue.

Here you can’t able to apply the patch and throw an error as mentioned above. Continue reading “How to fix Magento custom patch throws an error while patch applied?”

How product website relation are stored in catalog_product_website table Magento 2?

Magento catalog_product_website is used to store relations between a product and its associated websites.

If your Magento runs with multiple websites and the product is assigned to multiple websites, its relation with the website is stored in the catalog_product_website table.

Table catalog_product_website has two columns. Continue reading “How product website relation are stored in catalog_product_website table Magento 2?”