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( $...
Rakesh Donga's user avatar
  • 5,324
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 | +--...
Aaron Allen's user avatar
  • 8,969
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> ...
Eduan Lenine's user avatar
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/...
Janak Bhimani's user avatar
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/...
Sandipan S's user avatar
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
Minesh Patel's user avatar
  • 2,193
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> <...
MagePsycho's user avatar
  • 4,712
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 ...
Alex Constantinescu's user avatar
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="...
Sohel Rana's user avatar
  • 35.6k
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 ...
Goose84's user avatar
  • 2,559
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: ...
siux's user avatar
  • 186
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 ...
Mageworx's user avatar
  • 3,786
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.
Baby in Magento's user avatar
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.
Ashish Jagnani's user avatar
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->...
Rakesh Jesadiya's user avatar
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 ...
Kingshuk Deb's user avatar
  • 1,204
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 ...
MGento's user avatar
  • 1,509
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 ...
Chander Shekhar's user avatar
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, ...
Aarpi's user avatar
  • 51
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' ...
Jamy's user avatar
  • 165
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-&...
Muhammad Hasham's user avatar
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 ...
Suresh Chikani's user avatar
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 ...
Asish Hira's user avatar
  • 1,981
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 ...
Jaimin Sutariya's user avatar
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 ...
PЯINCƎ's user avatar
  • 11.6k
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="...
Prince Patel's user avatar
  • 22.6k
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\...
Amit Bera's user avatar
  • 77.2k
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 ...
Pavan Kumar's user avatar
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->...
Rohit Chauhan's user avatar
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, ...
Adam's user avatar
  • 587

Only top scored, non community-wiki answers of a minimum length are eligible