Enable Javascript

Please enable Javascript to view website properly

Toll Free 1800 889 7020

Looking for an Expert Development Team? Take 2 weeks Free Trial! Try Now

Magento 2: Personalization for the shopper

In this story, the Magento development services vendor will explain the importance of personalization for the buyers. Read this article carefully to find out how the personal experience makes a big difference for buyers.

Shopping is a personal experience. When people visit your site very rarely are they looking for the same thing, especially if you are a large retailer with a multitude of products? Shoppers deserve a personalized experience.

Experience for the customer

This experience will start with a call to action to entice the customer to log in. Make it a banner in your existing slider, make it a modal, or just make a larger button in the header. Once the customer has logged in you can pull their name and use it to drive their experience.

Try something simple, like the shopper's first name. You can access their name with the use of this code:

<?php $customerSession = $objectManager->get('Magento\Customer\Model\Session'); if($customerSession->isLoggedIn()) { echo $customerSession->getCustomer()->getFirstname(); } ?>

Generally, this would be placed in the header as a way to let people know they are logged in. However, this just pulls in the name of the customer. Need to have a little more efficiency. You can easily make it so that customers will first see the phrase, “Sign in and Register.” Then when they are logged in they will see their name and the option to “log out”.

Incorporate this with your other code. You can see where your existing code is already. Just paste this over it:

<ul class="nav navbar-nav login"> <?php if ($customerSession->isLoggedIn()): ?> <li class="logged-in-welcome"> <span>Welcome,</span> <?php $customerSession = $objectManager->get('Magento\Customer\Model\Session'); if($customerSession->isLoggedIn()) { echo $customerSession->getCustomer()->getFirstname(); // get Full Name } ?> </li> <?php endif; ?> </ul>

The code above creates the common logged-in and logged-out feature that you will see on most sites. Where else can you use this code to personalize your customer’s experience? Try adding the snippets below to customize your customer’s experience even more.

$customer->getPrefix(); $customer->getName(); // Full Name $customer->getFirstname(); // First Name $customer->getMiddlename(); // Middle Name $customer->getLastname(); // Last Name $customer->getSuffix();

Customization will set you apart from your competitors. Customers like to hear their names.

If you break apart the code above you can do just about anything for your logged-in customers. Specifically this block of code:

<?php $customerSession = $objectManager->get('Magento\Customer\Model\Session'); if($customerSession->isLoggedIn()) { //If the customer is logged-in, do this. } ?>

You can contact magento development services providers India avail personalized experience for your shoppers. For further queries and doubts, you can write comments here.

The above code is very powerful. It says, “If the customer is logged in, do this.” There are endless possibilities here. What about loading special CSS? What about introducing special sales or coupons? Feel free to experiment on a local sandbox.

Software Development Team
Need Software Development Team?
captcha
🙌

Thank you!
We will contact soon.

Oops! Something went wrong.

Recent Blogs

Categories

NSS Note
Trusted by Global Clients