public function context() {
// rule targets specific user, if this user is different we don't need to test the rule
if ( $this->user_id != 'all' ) {
if ( $this->user_id != get_current_user_id() ) {
return false;
}
}
if($this->user_id == "all")
{
if(get_current_user_id()===0)
{
return false;
}
}
return true;
}
It basically does everything from customer email to customer address data. It also provides column mapping and custom attribute import for all users. Also comes with multiple configuration options.
user_pass column will have this kind data from Magento2 dcbdc524f215fd054502dcad5a23a702ec029c02ff8d7051d049f76e29927f8b:C8yVqeuPfkHWvkmipx0iKLPtOUGETpLL:1
usermeta table must have a meta_key“migrated_cs” for this user, meta_value can be anything positive
This plugin file password-migrator.php should be in wp-content/plugins and must be an active plugin
What is does?
For new wordpress based users which dont have anything to do with magento2, it doesnt do anything
For all migrated users (those have the key “migrated_cs”), this plugin checks if input password matches old password from magento2 or not, if matched, it clears the key migrated_cs and updates the password using wordpress’ algorithm ; else results false.
SET FOREIGN_KEY_CHECKS = 0;
SET GROUP_CONCAT_MAX_LEN=32768;
SET @tables = NULL;
SELECT GROUP_CONCAT('`', table_name, '`') INTO @tables
FROM information_schema.tables
WHERE table_schema = (SELECT DATABASE());
SELECT IFNULL(@tables,'dummy') INTO @tables;
SET @tables = CONCAT('DROP TABLE IF EXISTS ', @tables);
PREPARE stmt FROM @tables;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET FOREIGN_KEY_CHECKS = 1;
Will not work via phpmyadmin or any script. this has to be run in cmd/terminal
By default, Woocommerce only validates ZIP code of few countries only. Woocommerce stores in India, are thus invalidated in case of PINCODE inputs from customers. Here is how you can enable checking of pincode for India woocommerce:
Put the following code in your custom function file or child theme functions.php
add_filter('woocommerce_validate_postcode','validate_indian_postcode',10,3);
function validate_indian_postcode($valid, $postcode, $country){
if($country=="IN")
$valid = (bool) preg_match( '/^([0-9]{6})$/', $postcode );
// checks your $postcode, if valid $valid will be true because of preg_match else false
return $valid;
}
Enable/Disable
Enable/Disable Enable Paytm Payments.
Title
Title
Paytm
This controls the title which the user sees during checkout.
Description
Description
The best payment gateway provider in India for e-payment through credit card, debit card & netbanking.
This controls the description which the user sees during checkout.
Merchant Identifier Merchant Identifier <provided link below> Merchant Id Provided by Paytm
API keys are unique credentials issued to every merchant. While MID is used as an identification used for all exchange correspondence, merchant key is used to encrypt every API request to Paytm and decrypt every response from Paytm. Ensure that you keep the merchant key on server side and should not be shared with anyone. In case API keys are compromised, please reach out to our helpdesk to get new API keys.
MID (Merchant ID) – Unique identifier issued to every merchant.
Merchant Key – This is a unique secret key used for secure encryption of every request. This needs to be kept on server side and should never be shared with anyone.
Industry Type ID – This is part of bank and paymode configuration done wrt to an account.
Website – This parameter is used to support multiple callback URLs to post the transaction response. Each URL needs to be mapped to a website parameter.
Test API Details are something like this:
Test Merchant ID WArHEFXXXXXXXXXXXXXX <–wont work
Test Account Secret Key XXXXXXXXOcv1u7P2 <- wont work
Note: In case you are testing on production environment, use live paymode details to complete the transaction. Once the transaction is successful, you can initiate refund from the dashboard.
The error message “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” can appear when you are using a PHP version which is incompatible with your scripts version. Meaning your WordPress installation is most likely outdated.
Since the ‘MySQL’ extension is no longer supported from PHP 7.0 and beyond, changing your PHP version to 5.6 or lower will fix the issue. This can be done via your website’s control panel’s PHP Configuration section.
So, let’s do it first and then we will see some probable causes of this error.
Steps:
Step 1- Login to your Cpanel.
Step 2- Find PHP PEAR Packages and click on it. and then click on show available modules.
Step 3- Find MYSQL and install the 3 extensions shown in the image above.
Step 4- Now Go to select PHP version.
Step 5- Now find MySQL (Use Ctrl + F), select it and save it.
That’s it. The problem is fixed. Let’s get to some probable causes of this error.
Probable causes of this error.
1. PHP’s MySQL extension not installed.
The quickest way to check if your PHP has MySQL support is to put the following code into a file called info.php in your site and access it from a browser.
<?
phpinfo();
?>
A MySQL section like this will be shown. If it’s not shown there, then you don’t have the PHP’s MySQL extension installed.
In Ubuntu servers and RedHat compatible servers, use the following commands respectivly:
2. Check if PHP’s MySQL extension directory is misconfigured.
Another cause of the ‘Your PHP installation appears to be missing the MySQL extension which is required by WordPress’. could be that the PHP extension directory is not configured properly.
In order to fix this, locate which PHP.ini file is being loaded and ensure that the appropriate “extension_dir” value is being used. So let’s open up the info.php file we created in Step 1 via our web browser.
Look for the line called “Loaded Configuration File”. The file path noted there is the actual location to the PHP configuration file.
Now, look for the entry called “extension_dir“. It should either be commented, or it should have the correct path to PHP extensions. It should never be left blank.
If you are not sure, just comment the line, and restart the web server.
Simply updating PHP and WordPress might also solve the problem.
In case you are running PHP 5, run the following commands:
apt-get update
apt-get install php-mysql
Restart the appropriate service for the changes to take effect.
This may have solved your problem. Feel free to comment below.