It will be advisable to add an index to a database field for better performance and quick selection of records from the database table. Use the below snippet to add an index to database field in Magento 2.
Magento
“Your session has expired” On Clicking Add To Cart – Magento 2.3.x Localhost
In your Magento 2 journey, you might have greeted with this error message – “Your session has expired”, when clicking on the add to cart button.
Magento 2.x: How to reset Customer Password from Database using SQL
If you need to reset the password in Magento 2 via MySQL database, use the below script.
How to Use Magento 2 code in external File/Script
This script allows you to call Magento 2 functions run outside Magento 2 setup. You can create any PHP file in Magento 2 root folder and run Magento 2 from there.
How to Add Store Codes to the URLs in Magento 2?
If you have a multi-language store and want to add Store Codes to this is the tutorial for you. So your example urls will look like this yourdomain.com/en, yourdomain.com/us, yourdomain.com/uk. Follow the below steps. Login to the Magento 2 admin panel Navigate to Stores > Configuration > General > Web and find the Url Options […]
Remove .html from Category URL & Product URL in Magento 2
Default Magento 2 setup comes with .html for all category and product URLs. Some of the store owners will go with a .html at the end of the url, but these everybody tend to remove that and keep looks more like browsing through folders. To remove .html from Category URL & Product URL in Magento […]
Product Sort By Price: Low to High and High to Low Magento 2.3
Today’s tutorial we are showing, how to add a new filter option in the product listing area of Magento 2.3. Here we are adding price sorting options such as Low to High and High to Low.
Reset “Use Secure in Front End or Admin” in Database – Magento 2
If you ran into a problem like you have changed the secure admin URL back to non secure URL and you forgot to change the or Admin to zero -means disable. It’s total mess that you cannot access the admin side again as all the JavaScript and CSS urls will have https prefix and all […]
Magento 2 Folder & File permissions
To give proper permissions for Magento 2 folders and files, follow the below commands. This commands should be running as root, but do not run magento command line – bin/magento- from root user, as this may create files with wrong user and throws permission errors. Once you ran this commands you can safely switch to […]
Magento2 – How to create custom breakpoints?
Today no one can think about a website without responsive design. Magento 2 is well equipped with responsive design ideas. There are certain most used break points are available in the Magento 2. But what if we want to add a custom break point to your existing application. Follow the below steps. Create a variable […]
How to Install Magento 2.3 & Create a Web Server-LAMP
This tutorial demonstrates how to install Magento 2.3 and build a web server on operating system Ubuntu 16.04 LTS. In this tutorial I have used Digital Ocean droplet (2GB instance), you may please create the same or you can install one in your PC. First we create a user apart from root user, as it […]
Magento2 :: How to get getRequest in Custom Module
If you are trying to use getRequest() from a controller that extends Magento\Framework\App\Action\Action, you may just use $this->getRequest()->getPost(). But if you are in a custom class, you need to inject the request in the constructor.
How to convert an array to a collection object in Magento 1?
We use the below when we have an array from a direct sql used in Magento 1 project. And we want to use it in the Magento way, the collection object. By using this we will be capable of using setters and getters same like any other collection in Magento. Creating a Collection <?php $resource […]
Magento 1: Load store specific product
Magento have the ability to setup different stores. A product can be made visible in different stores and if we want load store specific details, use the below code.
20+ Best Magento Website Templates Free & Premium
Ultimo – Fluid Responsive Magento Theme Demo Download/More Info Porto | Ultimate Responsive Magento Theme Demo Download/More Info Shopper – Magento Theme, Responsive & Retina Ready Demo Download/More Info Fortis – Responsive Magento Theme Demo Download/More Info Fastest Demo Download/More Info Market – Premium Responsive Magento 2 Demo Download/More Info Claue Demo Download/More Info Black&White Demo Download/More Info Everything | Multipurpose Responsive Magento […]
How to run Magento code externally?
When you work with Magento, it’s often needed to use the Magento classes and Models outside the Magento core. What I meant is when you want to create a customer programatically outside Magento’s framework,, may because of a custom functionality that you want to build on some other applications. Copy the below code to run […]
How to change logo for PDF invoices & print-outs- Magento 1.9
1) Open Magento admin area. Navigate to System -> Configuration -> SALES -> Sales 2) Open the tab Invoices and Packing Slip Design . In the browse button you can select your company’s logo and in the Address box you can write the address of your company.
Magento 1.9 – Get Customer Details By Email Id
In this example we are showing how to get customer details by email Id.We have gotten email id, but we need to get the details of a customer using the email id. Here is the solution to get the customer data using the email id.Here’s how to do it. <?php $email = “customer@gmail.com”; $customer = […]
Best Responsive themes for Magento for Online shops 2017
Magento, the most popular e-commerce platform powering a number of eCommerce websites in the internet world. Why people choose Magento for their eCommerce website It’s free Massive features focused on eCommerce operations Huge community supporting Magento with numerous extensions Latest security updates for your website It is a must that your website should work any […]
How to disable the categories path in URL in Magento 1?
Magento has a functionality that allows you to layered category names in the product URL. You can enable/disable this feature from Magento admin panel. Why some of you want to disable this because this is causing some serious SEO problems as it creates duplicate URLs. System => Configuration => Catalog => Catalog => Search Engine […]
Mirasvit Fast Asynchronous Re-indexing Magento Extension
Magento Re-indexing seems to be a pain for all Magento store owners. It would be worse when you have a huge e-commerce website having numerous amount of products. Every time you save a product or a category, Magento produces data re-indexing in a database. If you have a store of 40K products, the indexing would […]
Get product id in magento
We can get product id from product object in Magento. Method 1 You can get the product ID from a collection Method 2 This way we can retrieve currently loaded product’s id.
Mirasvit Sphinx Search Ultimate – Magento search reviews
In this article, we review an excellent Magneto Extension called Sphinx Search Ultimate from Mirasvit. This module basically unites 3 modules, Search Spell-Correction, Search AutoComplete & Suggestions and Advanced Sphinx Search Pro into a single operating mechanism. The built-in search in Magento community version can be a pain for some users as it won’t give […]
Path “sitemap.xml” is not available and cannot be used.
If you ever try to create a second sitemap for another store view in Magento you will get the below error Path “sitemap.xml” is not available and cannot be used. Even if you give a different file name like sitemap_en.xml, you will get this same error What is the solution? How to create a sitemap.xml […]
How to Display Products that are Out of Stock in Magento
By default, Magento will not display products that are out of stock. If a product has no stock , the website’s visitors will not see it. This is actually not listing all your products, that temporarily out of stock. Step 1: Log into your Magento Admin Panel Step 2: Go to System -> Configuration Step […]
Get URL Paths in Magento for CMS Blocks and Pages
Magento has the CMS pages option to handle the static pages for your website. You can use the following code to get URL Paths in Magento for CMS Blocks and Pages To get SKIN URL -> {{skin url=’images/image.jpg’}} To get Media URL -> {{media url=’images/image.jpg’}} To get Base URL -> {{base url=’store/contact’}} To get Store […]
How to get attribute option label/attribute text with option_id?
How to get attribute option label/attribute text with option_id? Use the below code.
Change of Magento contacts page URL
Magento’s default contact us form page URL is a little bit awkward as its says http://yourdomain.om/contacts. We can change this easily by creating a small module.
Direct SQL queries in Magento
This tutorial mainly demonstrates direct SQL queries in Magento. Magento data models are giving great flexibility for the data processing. We don’t need to touch the complex SQL statements because of this feature. This often gives really quick development speed and accuracy more over a bulletproof approach. But several situations it much needed to execute […]
Search by only product name in Mini Search In Magento
Magento has a good search functionality. By default when someone searches it search through all the description and short descriptions. So sometimes at first look this results appears to be strange. We need Search by only product name in Mini Search In Magento But the reason Magento pick this up because these keywords might be present […]