23
votes
Accepted
SodiumChachaIetf::decrypt() must be of the type string, boolean
Go to Below file:
vendor/magento/framework/Encryption/Adapter/SodiumChachaIetf.php
And Update Below Code on decrypt() method:
$plainText = sodium_crypto_aead_chacha20poly1305_ietf_decrypt(
$...
22
votes
Accepted
Magento 2 - Redirect user to specific page after register
I think the problem is that your redirect is occuring before the default redirect and hence has no effect.
Here's a module that does the job:
Module directory structure:
| registration.php
|
+--...
15
votes
SodiumChachaIetf::decrypt() must be of the type string, boolean
Looks like you are using the wrong crypt key.
You should keep the key from your previews configuration:
app/etc/local.xml [Magento 1.x]
<?xml version="1.0"?>
<config>
<global>
...
10
votes
Magento 2 - Add custom attribute in customer registration form
If your install data script successfully installed your custom attribute, now you just need to override addition information phtml file and set your custom attribute in that.
Create Vendor/TestModule/...
7
votes
SodiumChachaIetf::decrypt() must be of the type string, boolean
Modifying the core class is not recommended at all. The issue is not with the class vendor/magento/framework/Encryption/Adapter/SodiumChachaIetf.php
But the issue with the crypt key added to your app/...
6
votes
*Completely* Disabling Frontend Customer Registration
You can add custom URL Rewrite Rules in admin panel as well. check below example to redirect customer/account/create to customer/account/login
6
votes
Accepted
*Completely* Disabling Frontend Customer Registration
You can simply use event controller_action_predispatch_customer_account_create to disable registration.
Register the event-observer
<events>
<...
6
votes
Accepted
How to make checkbox mandatory on register page in Magento 2
data-validate="{required:true}" will do the trick
<div class="field choice newsletter">
<label for="custom-terms" class="label"><span><?php /* @escapeNotVerified */ echo ...
6
votes
Accepted
Adding a required unchecked check box for Terms and Conditions on new account registration
Try following way:
Step 1: VendorName/ModuleName/view/frontend/layout/customer_account_create.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="...
5
votes
How to make the same name of the customer only once registered
Many people have the same name so I would strongly advise against trying to block users!
If you believe your site is being targeted by bots I would suggest you implement Google Recaptcha on the ...
5
votes
Adding a required unchecked check box for Terms and Conditions on new account registration
The accepted answer works, but only makes sense if you want to really create your own code.
If you want to use magento native agreements that are also used in checkout, do the following:
...
4
votes
Accepted
Registration on Success Page
Judging by your screenshot, you are using custom theme. That’s why you need to localize this page (success page) first. Make sure that it has the call getChildHtml. If there is not such a call, then ...
4
votes
Accepted
Internal server error 500 in particular pages
In root of magento, you can see index.php file, you can un comment these lines in that file :
#ini_set(‘display_errors’, 1);,
Then you can see the real errors that causing the problem.
4
votes
Accepted
How to remove firstname, lastname validation (magento 1.9)
You need to change the database value for this attribute
Table name : eav_attribute In this table find attribute_code as firstname and change the value of is_required to 0. Do same for lastname.
4
votes
Accepted
how to check if current page is login page and how to check current page is registration page
You can call below function in your template and get page info in magento 1
,
$request = $this->getRequest();
$modulename = $request->getModuleName();
$controller = $request->...
4
votes
Accepted
Registry in Magento 2
If you go to Magento\Framework\Registry you can see a __destruct method specified there.
Register basically stores your data inside an array type object using key value pair.
As soon as you stop ...
4
votes
Accepted
Magento 2 set & get Registry values
The registry is getting cleared after the server sends a response. Each new request starts with an empty registry.
If you want to transfer data from one request to another you should use the session ...
4
votes
Accepted
How to get registered customer details in order success page(success.phtml) in M2.2?
Try to use below code:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $objectManager->create('Magento\Sales\Model\Order')->load($block->getOrderId()); // pass ...
4
votes
SodiumChachaIetf::decrypt() must be of the type string, boolean
Go to this file:
vendor/magento/framework/Encryption/Adapter/SodiumChachaIetf.php
And update below code:
public function decrypt(string $data): string
{
$nonce = mb_substr($data, 0, ...
4
votes
How to add user in magento by custom code?
This code for creating customers in Magento 2:
$data = array(
'website_id' => 0,
'email' => '[email protected]',
'firstname' => 'Mac',
'lastname' => 'Hamon',
'group_id' ...
4
votes
Accepted
How to add user in magento by custom code?
One of the example of creating customer
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$appState = $objectManager->get('\Magento\Framework\App\State');
//$appState-&...
3
votes
Magento 2 - Remove last name from registration form
You have to copy file from
projectroot\vendor\magento\module-customer\view\frontend\templates\widget\name.phtml
And paste to in you theme.
You can find class field-name-lastname in code. delete ...
3
votes
Accepted
New user registration Showing error " We Can't save the customer "
Go to core/mage/customer/controller/AccountController.php and find function named createPostAction(). In that function add
die($e->getMessage());
Just after catch (Exception $e) {.
You can see ...
3
votes
Accepted
How can I override the registration page?
It is because you are making changes to wrong files. The correct file for registration form should be
app/design/frontend/base/default/template/persistent/customer/form/register.phtml
So copy the ...
3
votes
Accepted
Register form field
Base you need on this solution and customise it according to the fields that you want to add.
We will create a new extension to make it clean.
Let's call the extension StackExchange_Customer.
You ...
3
votes
Accepted
How to redirect user to specific page after register in Magento 2
Create events.xml at
app/code/Vendor/Module/etc/frontend/events.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="...
3
votes
Accepted
Custom redirect user to specific page after register Observer in Magento 2 will just redirect after the cms page to the login page
You does not login because of before execute of $this->session->setCustomerDataAsLoggedIn($customer); code your observer is redirect to your page.
if you will check at Magento\Customer\...
3
votes
Magento 2 set & get Registry values
The registry will load once the controller is loaded. One more point, registry function should be called in block file only. It is the best way of doing.
So as you are calling the registry inside ...
3
votes
How to get registered customer details in order success page(success.phtml) in M2.2?
Try to use below code for registered and guest customers...
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of object manager
$order = $objectManager->...
3
votes
No such entity with customerId
I think the answer is actually here github issue - 23411, meaning it is a false positive.
I have created a patch that downgrades the message from 'error' to 'info'. So that visibility is maintained, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
register × 211magento-1.9 × 66
customer × 52
magento2 × 49
customer-account × 29
login × 26
checkout × 14
forms × 13
onepage-checkout × 11
php × 10
event-observer × 10
magento-1.7 × 9
attributes × 8
magento-2.1 × 7
magento-1 × 7
registration × 7
customer-attribute × 6
customer-group × 6
layout × 5
magento-community × 5
magento2.3 × 4
magento-1.8 × 4
email × 4
template × 4
controllers × 4