Tự động cho user vô danh checkout trong Drupal Commerce

Tự động cho user vô danh checkout trong Drupal Commerce

Here's a quick howto on how to log in a new user right after the point of purchase in the case of an anonymous checkout in Drupal Commerce. This way a user doesn't have to go 'off-site' to check their email and confirm their account. You give them access to the account right at the point of purchase and you can instantly show the user content that's only available for users.

Step 1 - Make sure anonymous checkout is enabled

Check and make sure your anonymous user has access to the stores checkout at admin/people/permissions. The permission is called 'Access checkout' under 'Checkout'.

Permission to access Commerce Checkout

You can read more about the differences between authenticated and anonymous checkout in Drupal Commerce in this article.

Step 2 - Enable the module

Enable the Commerce Immediate Login module in Simon Georges's sandbox at  http://drupal.org/sandbox/simongeorges/1676742 - Thank you Simon for making this possible!

Step 3 - Add the Login action to the Rule

  • Edit the Rule "Create a new account for an anonymous order" at Administration -> Configuration -> Workflow ->Rules (it's located at admin/config/workflow/rules/reaction/manage/commerce_checkout_new_account). 
  • Click 'Add action' at the bottom of the page
  • Select 'Log in user' as the action to add (it's located under System)
  • enter 'account-created' as data selector.
  • (save)

The Rule result is supposed to look like this:

The action to add to the Rule to enable automatic login

Step 4 - Test, Enjoy & Give back

Now make sure to test your checkout process for anonymous users. Be aware of the fact that 'the devil is in the detail' regarding the checkout process. Make sure to test test test. And remember: adding your experience and test results to the designated issue queues makes your own Drupal site better :) thanks.

Important note

"Just remember not to use this feature on the rule to Assign an anonymous order to a pre-existing user, as there is in core no password verification to ensure the anonymous user actually owns the account associated with the e-mail address they entered on the checkout form."  (Ryan Szrama)

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Drupal hosting: www.GetPantheon.com

Lứơt qua Drupal hosting: www.GetPantheon.com

There is one question we get time and time and again from developers who are new to Drupal: "How do I create a staging environment for my sites?"

Cho thuê hosting chuyên dụng cho Drupal website

Cho thuê hosting chuyên dụng cho Drupal website

Hosting là không gian lưu trữ mã nguồn để chạy website, nếu Domain (Tên miền) là địa chỉ nhà của bạn, thì Hosting là khu đất để xây nhà.

Drupal: Không được CLONE THE DATABASE

Drupal: Không được CLONE THE DATABASE

It is generally agreed that cloning the database downstream (that is, from development toward production) is a bad idea, if only because by doing so all production content is lost; most developers use Features,

Công ty diệt chuột T&C

 

Diet con trung