Problem Sometimes a scenario comes when the indexing process gets locked at the time of reindexing. When the process or the index type is locked then you cannot reindex that particular locked index type. The reindex will always skip that index type. For example, let us assume that the Stock index type is locked. Then,…
Magento: Get Custom Options & Configurable Product’s Options on Shopping Cart
This article shows how you can get custom options values and configurable options values in shopping cart page in Magento 1.x. We use the checkout session quote collection for this purpose. Here’s the full code: // Get visible items collection in shopping cart $itemsCollection = Mage::getSingleton(‘checkout/session’) ->getQuote() ->getAllVisibleItems(); foreach ($itemsCollection as $item) { // Get…
Magento 2: Enabling/Viewing Full Error Display
In Magento 2.x, the full error display on frontend is disabled by default. This article shows different methods on how you can see the full error message in your Magento 2 website. I have written another article on how to Enable/View Full Error Display on Magento 1.x. This one is a similar article for Magento…
Magento 2: Get Simple Product ID & Quantity in Configurable Product using Swatches
This article shows how you can get the associated Simple Product ID and Quantity (Qty) / inventory from a Configurable Product in frontend product detail page in Magento 2.x. – The below code assumes that Swatches have been used in the product detail page. – Suppose you have two configurable attributes (color and size) for…
Magento 2: Admin Login Error – Your current session has been expired
Problem: – I did a new installation of Magento 2.2.5. – While installing it, I had disabled the third party modules installation. – The installation was successful. – Frontend opens fine. – Backend opens fine. – However, when I try to login to backend admin with the correct username and password, I get the following…
Magento 2: Forbidden You don’t have permission to access /magento2/ on this server. Server unable to read htaccess file, denying access to be safe
ow, when I browse http://127.0.0.1/magento2, I get the following error: Forbidden You don’t have permission to access /magento2/ on this server. Server unable to read htaccess file, denying access to be safe I checked the file permission and file ownership of all the files and folders inside the magento2 directory and everything seems to be…
Magento 2: Create Customer Programmatically
– through dependency injection – through object manager Create Customer using Dependency Injection Please note that, in this example, my custom module “HelloWorld” path is: app/code/Chapagain/HelloWorld/ I have an Add controller file which can be browsed like: http://127.0.0.1/magento2/helloworld/customer/add Browsing this path will show a form and its action is to the Addpost controller. The Addpost…
Magento 2: Create Product Attribute, Attribute Group/Tab & Attribute Set Programmatically
This article shows how you can programmatically add or create a new product attribute, product attribute group, and product attribute set in Magento 2. This article shows a lot of things like the following: 1) Create Product Attribute 2) Update Product Attribute 3) Remove Product Attribute 4) Create Product Attribute Group/Tab (A group/section/tab which contains…
Magento 2: Create Customer Attribute Programmatically [Also Update & Delete Customer Attribute]
This article shows how you can programmatically add or create a new customer attribute in Magento 2. It also shows how you can update and delete/remove the customer attribute programmatically in Magento 2. I will also show how you can add the product attributes from both Install Script and Upgrade Script: – Add customer attribute…
Magento 2: Return JSON, XML, HTML & Raw Text Data Response from Controller
This article shows how you can return JSON data, XML data, HTML data, or Raw Text data from any Controller class in Magento 2. Generally, in the Magento2 controller’s execute() function, we see the redirect or forwarding call which redirects to the specified URL page. However, we might sometime need to return the JSON format…
