Hey there, fellow e-commerce enthusiasts! Let's talk about spicing up your online business game with some top-notch solutions. If you've been on the lookout for ways to boost your online store's efficiency, you're in luck! Enter Magento - the superhero among e-commerce platforms that's been hitting the mark.
Hey, savvy e-commerce wizards! Are you ready for a whirlwind adventure into the vibrant world of online selling? Picture this: you're about to embark on a quest to find the ultimate e-commerce platform that'll skyrocket your business to the stars. Today, we're spilling the beans on the hottest topic around – the top alternatives to Magento in 2024.
Hey there, fellow Magento store managers!
What’s the best way to improve customer loyalty and stay ahead of the competition? Based on our experience as a leading Magento extensions company, we believe that personalisation is the key to sustainable success. For personalisation, you need access to large amounts of customer data. Undoubtedly, data is the new oil in today’s digital world. The more data you have, the more likely you are to succeed. Consider companies like Meta, Twitter, and others. While they claim to be social networking platforms, their success is tied with data. They offer unparalleled levels of insights into individual users to businesses. This allows the businesses to serve these individuals with highly personalised ads. Magento 2, the platform allows merchants to add customer attributes. An attribute is simply an information that provides additional details on the customer or prospect. These attributes help store owners understand their audience better. Although the default Magento 2 customer attributes are limited but Magento 2, being an open source and highly scalable platform allows to add custom attributes programmatically. Some examples of custom customer attributes are Date of Birth, Interests/Hobbies, Mobile number, ‘How did you find us?’, etc. Ready Made Extension for Customer Attributes: Magento 2 Custom Registration Fields About the Extension If you don’t wish to create a customer attribute in Magento 2 programmatically, use our extension . Why? This extension is quite easy to set up and use. Apart from its user-friendliness, this extension offers a wide range of features that can transform your store. For example, you can add 13 different types of customer attributes as shown below through this extension. You can define any field as mandatory or optional. If you require a specific data type to enhance your pricing or marketing strategy, you can make the relevant fields as mandatory. You can tailor each field to your liking. For instance, you can change their order, placement, and more. If you wish to know more about this extension, book a live demo . 3 Simple Steps to Add Customer Attribute Programmatically in Magento 2 Follow these steps to add the customer attribute programmatically: Step 1: Create the Setup File InstallData.php First of all, create the InstallData.php file: File Path: app/code/Company/Mymodule/Setup/InstallData.php <?php namespace Company\Mymodule\Setup; use Magento\Eav\Model\Config; use Magento\Eav\Setup\EavSetup; use Magento\Eav\Setup\EavSetupFactory; use Magento\Framework\Setup\InstallDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; class InstallData implements InstallDataInterface { private $eavSetupFactory; public function __construct( EavSetupFactory $eavSetupFactory, Config $eavConfig ) { $this->eavSetupFactory = $eavSetupFactory; $this->eavConfig = $eavConfig; } public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]); $eavSetup->addAttribute(\Magento\Customer\Model\Customer::ENTITY, 'custom_text_field', [ 'label' => 'Middle Name', 'system' => 0, 'position' => 700, 'sort_order' => 700, 'visible' => true, 'note' => '', 'type' => 'varchar', 'input' => 'text', ] ); $this->getEavConfig()->getAttribute('customer', 'custom_text_field')->setData('is_user_defined', 1)->setData('is_required', 0)->setData('default_value', '')->setData('used_in_forms', ['adminhtml_customer', 'checkout_register', 'customer_account_create', 'customer_account_edit', 'adminhtml_checkout'])->save(); $eavSetup->addAttribute(\Magento\Customer\Model\Customer::ENTITY, 'custom_dropdown', [ 'label' => 'How did you hear about us?', 'system' => 0, 'position' => 700, 'sort_order' => 700, 'visible' => true, 'note' => '', 'type' => 'int', 'input' => 'select', 'source' => 'Company\Mymodule\Model\Source\Customdropdown', ] ); $this->getEavConfig()->getAttribute('customer', 'custom_dropdown')->setData('is_user_defined', 1)->setData('is_required', 0)->setData('default_value', '')->setData('used_in_forms', ['adminhtml_customer', 'checkout_register', 'customer_account_create', 'customer_account_edit', 'adminhtml_checkout'])->save(); $eavSetup->addAttribute(\Magento\Customer\Model\Customer::ENTITY, 'custom_yes_no', [ 'label' => 'Are you an existing customer?', 'system' => 0, 'position' => 700, 'sort_order' => 700, 'visible' => true, 'note' => '', 'type' => 'int', 'input' => 'boolean', 'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean', ] ); $this->getEavConfig()->getAttribute('customer', 'custom_yes_no')->setData('is_user_defined', 1)->setData('is_required', 0)->setData('default_value', '')->setData('used_in_forms', ['adminhtml_customer', 'checkout_register', 'customer_account_create', 'customer_account_edit', 'adminhtml_checkout'])->save(); } public function getEavConfig() { return $this->eavConfig; } } The above code will create the following three custom attributes. Middle Name → Text Field How did you hear about us? → Dropdown Are you an existing customer? → Yes/No “How did you hear about us?” is a select box and we have defined a custom source: Company\Mymodule\Model\Source\Customdropdown So, we need to create the source file as well. Similarly, if you are looking for Magento 2 add customer address attribute programmatically, just follow the same instructions. Step 2: Create the Source File Now, create the Source File File Path: app/code/Company/Mymodule/Model/Source/Customdropdown.php <?php namespace Company\Mymodule\Model\Source; class Customdropdown extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource { public function getAllOptions() { if ($this->_options === null) { $this->_options = [ ['value' => '', 'label' => __('Please Select')], ['value' => '1', 'label' => __('Google')], ['value' => '2', 'label' => __('Friend')], ['value' => '3', 'label' => __('Email')], ['value' => '4', 'label' => __('Other')] ]; } return $this->_options; } public function getOptionText($value) { foreach ($this->getAllOptions() as $option) { if ($option['value'] == $value) { return $option['label']; } } return false; } } Step 3: Upgrade Open terminal/SSH and navigate to Magento 2 setup root directory and run the commands below. php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f Moreover, you can add other types of fields like customer address attribute, radio buttons, contact number field, etc. using above script. You can also check more details regarding customer attributes in this magento user guide . Final Thoughts on Magento 2 Add Customer Attribute Programmatically If you have any issue in adding custom customer attribute programmatically in Magento 2, then feel free to contact our support team for a quick fix.
Competition in eCommerce is at an all-time high. Based on our experience as a leading Magento extensions company, we believe that competition will only increase further. Therefore, whether you have an existing store or planning to launch one, you need to start finding ways to differentiate your store from the competition. One way to achieve this is through custom product labels. With the use of captivating and informative labels, you can capture the audience’s attention, compelling them to engage with your store. With the use of Magento 2 product labels feature, creating custom product labels has never been easier. Before we talk about creating custom product labels, it is pertinent to understand what these labels are. What is a Magento 2 Product Label? Product labels, also known as product tags or product badges, are small icons or images displayed at the right or left corner of the product image to convey information such as discounts, top rated, best sellers, etc. Labels can be displayed on both the product and catalog pages. Product labels offer numerous benefits for any online store. Source: FMEextensions For example, labels such as “30% Off”, or “Buy 1, Get 1 Free” are a great way to entice customers to make a purchase. Similarly, labels like "Certified Organic," "Made in the USA," or "Satisfaction Guaranteed" can build trust and credibility with customers. They are useful in highlighting product promotions, new arrivals, best sellers, etc. on category and product pages to draw customer’s attention. The below picture provides an idea about product labels and their effectiveness. Source: Amazon.com We did a quick search for ‘gaming chairs’ on the Amazon website. The above picture depicts the first four results. Now, tell us which product you would explore first? In other words, which link are you more likely to open first? Nine times out of 10, a visitor will click the ‘Best Seller’ and ‘Overall Pick’ products. The reason is they know that other individuals value these products the highest. It instils trust in them, and they can complete their purchase without undertaking considerable research. Thus, we can conclude that the use of product labels is helpful in grabbing user attention, building trust, speeding up the purchase decision, and so much more. Now that you understand what product labels are, let’s see how to create custom product labels for Magento 2. The Need to Use Magento 2 Product Labels Extension Please note that Magento does not offer an in-built feature to create custom product labels. You can add a product label by uploading a custom icon and associating it with the required product. This is a tedious task considering if you have a catalogue of hundreds of products. Therefore, you’ll be needing a Magento 2 product label extension . How is an extension helpful? Obviously not every Magento 2 product label extension is the same. Nevertheless, they offer common features such as pre-made images for the widely used characteristics such as “Top rated”, “Best seller”, “% Off”, and many more. You can also automate the process of displaying labels on specific products by using conditions. How To Create Custom Product Labels in Magento 2? FME Extensions has a pre-built extension for creating custom product labels in Magento 2. You can book a live demo here or ask for customisations to suit your unique requirements. The Product Labels extension by FMEextensions allows you to add as many custom labels as needed. After installing it, all you need to do is go to FMEExtensions > Manage Labels Rules > Add New Rule. You have a wide range of options, including: Main: Provide general information about your label such as title, start and end date, customer group, etc. Conditions: Here you need to set conditions to automatically display the label on specific products. You can use product attributes such as SKU, Category, etc. to set conditions. Product Label: Here you can select any of the pre-made labels or upload a custom label and set its position, text, text color, label color, label size, etc. Category/Wishlist Product Label: Here you can configure the same settings for category, Wishlist, and compare pages. The best thing about this extension is that you don’t need to create product labels in Magento 2 manually. Instead, you can automate the entire process. As you can see from the above image, you can simply define the criteria for different product tags. As soon as you upload the relevant product, the extension will automatically add the label. Important Tips to Use Magento 2 Product Tags While labels can be beneficial, avoid overwhelming your product images with too many labels. Select the most relevant and impactful labels to avoid clutter. Position labels on product images appropriately to prevent overlapping. Also, adjust the size of the labels to make sure the text is readable. Additionally, if you are using custom labels, make sure graphics are of high quality and resolution. Conclusion This concludes our article on how to create custom product labels in Magento 2. If you have any questions, don’t hesitate to contact us .
While reading the title, you may be wondering why any store would want to hide product prices in Magento 2 regardless of whether the customer is logged in. After all, price is often the topmost or only factor the target audience considers when contemplating a purchase. However, there are situations such as guest users where you may want to hide product prices. In this article, we will guide you about everything there is to know about the Magento 2 hide price for guest. Before doing that, let’s discuss why you need to implement the Magento 2 hide price if not logged in feature. Hide Price For Guest Hide Price For Guest extension allows you to hide prices from non-logged-in visitors. Check it out! > Why You Need to Hide Price if Not Logged-In? Magento 2 hide prices unless logged in feature is something that every store owner should consider. Here’s why: 1. Encouraging User Registration You may have heard the phrase data is the new oil. Given that we are living in the digital age, data is indeed the new oil. A guest user does not offer much data to store owners which they can use to create personalised marketing strategies. When the same user creates an account, they share information such as their email, phone number, and more. From a store owner’s perspective, this information is a gold mine. They can use it to send personalised messages, recommend products that align with the user’s interests, and more. If users don’t have any incentive to register with your store, 9 times out of 10, they will ignore the registration process. However, by hiding the prices, you are giving them a good reason to create an account. 2. Segmentation Suppose your store gets 1000 users daily. 900 are guest users, meaning they are not logged in. How would you know how to retarget these visitors or what products to recommend them? When users are logged in, you can easily gather information related to their preferences, purchasing behaviour, and demographics. By segmenting users based on different parameters, you can create more effective marketing strategies and recommend the most relevant products. This can boost your sales and customer engagement. 3. Control over Pricing Visibility In some cases, you need to implement the Magento 2 hide price for guest feature simply because of your pricing strategy. You may opt for tier pricing or sell on different rates to each customer. Therefore, there’s no point in displaying any price. Instead, you need to add a ‘Ask for Quote’ button. Check Out Our Extensions Related to Tier Pricing: Customer Group Pricing Dimension Tier Pricing 4. Preventing Price Comparison It wouldn’t be wrong to say that everyone is trying their hands at eCommerce nowadays. From the customer’s perspective, more stores mean more choice. From the store owners’ perspective, it means high competition. While competition is always healthy, too much of it can overwhelm businesses. Customers tend to browse 10, 15 sites before committing to a purchase. If you wish to avoid becoming just another website that users flip through when considering a product, hide the prices. This will capture their curiosity and compel to sign up. This is where you can convert them to a customer. As soon as they sign up, start sending them personalised messages. With the use of engaging messages and promotions, you can compel users to stick with your website. 5. Differentiate Yourself One of the ways to attain success in eCommerce is through differentiation. Everyone is displaying the prices. By hiding the prices, you can create a point of differentiation. Create curiosity in your audience’s minds and compel them to sign up. How to ‘Magento 2 Hide Price if not Logged In’ There are different ways to hide the price in Magento 2 for guest users. Let’s discuss them in detail. Method 1 - Magento 2 Hide Price for Guest Extension One of the easiest methods to hide the prices for not logged in users is to use an extension. We already have one for this very purpose. Of course, this extension offers a lot more than just hiding prices for not logged in users. Through this extension, you can hide prices for specific products and customer groups. You can also hide prices for specific product categories. That’s not all. You can hide prices for specific time periods. This can be a great help during holiday seasons when eCommerce sales really take off. If you are interested in knowing more about this extension, book a live demo . Method 2 – Custom Code Following is the code you need to add to hide price for not logged in users in Magento 2. Step 1. Create di.xml in Vendor\Extension\etc folder. <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> <preference for="Magento\Catalog\Pricing\Render\FinalPriceBox" type="Vendor\Extension\Pricing\Render\FinalPriceBox" /> <preference for="Magento\ConfigurableProduct\Pricing\Render\FinalPriceBox" type="Vendor\Extension\Pricing\Render\FinalPriceBox" /> </config> Step 2. Create FinalPriceBox.php at Vendor\Extension\Pricing\Render folder. namespace Vendor\Extension\Pricing\Render; use Magento\Catalog\Pricing\Price; use Magento\Framework\Pricing\Render; use Magento\Framework\Pricing\Render\PriceBox as BasePriceBox; use Magento\Msrp\Pricing\Price\MsrpPrice; class FinalPriceBox extends \Magento\Catalog\Pricing\Render\FinalPriceBox { public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Pricing\SaleableInterface $saleableItem, \Magento\Framework\Pricing\Price\PriceInterface $price, \Magento\Framework\Pricing\Render\RendererPool $rendererPool, array $data = [], \Magento\Catalog\Model\Product\Pricing\Renderer\SalableResolverInterface $salableResolver = null, \Magento\Catalog\Pricing\Price\MinimalPriceCalculatorInterface $minimalPriceCalculator = null ) { parent::__construct($context, $saleableItem, $price, $rendererPool, $data, $salableResolver, $minimalPriceCalculator); } protected function wrapResult($html) { $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $httpContext = $objectManager->get('Magento\Framework\App\Http\Context'); $isLoggedIn = $httpContext->getValue(\Magento\Customer\Model\Context::CONTEXT_AUTH); if($isLoggedIn) { return '<div class="price-box ' . $this->getData('css_classes') . '" ' .'data-role="priceBox" ' . 'data-product-id="' . $this->getSaleableItem()->getId() . '"' . '>' . $html . '</div>'; } else { $wording = 'Login To See Price'; return '<div class="" ' .'data-role="priceBox" ' .'data-product-id="' . $this->getSaleableItem()->getId() . '"' . '>'.$wording.'</div>'; } } } The above code will hide price for non-logged in customers in Magento 2. If you want to implement advanced features such as hiding add to cart button, Magento 2 hide price for guest is the extension you will want to use. Conclusion This concludes our article on how to add the price for not logged in customers in Magento 2. When used correctly, this feature can be a great way to boost your sales and customer engagement. Please feel free to contact us if you have any questions. Related Articles: How to Hide Add to Cart Button in Magento 2 How to Enable Single Store Mode in Magento 2 How to Setup 1and1 Webmail SMTP in Magento 2