Magent 2: Load Configurable Product with Options pre-selected

This article shows how you can load any configurable product in Magento with the configurable options pre-selected. We can append the Attribute-OptionValue hash value (#Attribute_ID=Value_ID) at the end of the configurable product URL. For example, let’s suppose that the configurable product URL is: https://example.com/my-configurable-product.html We can add the attribute option values like this: https://example.com/my-configurable-product.html#802=130&805=187 #Attribute_ID=Value_ID … Read more

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 … Read more

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 … Read more

Associated Simple Product Price in Cart: Magento Extension [FREE]

Associated Product Price in Cart is a FREE Magento extension that uses the associated simple product’s price in shopping cart instead of the configurable product’s price. This module is compatible with Magento version 1.5 and later (Magento 1.5, 1.6, 1.7, 1.8, 1.9). Sometime, you have a scenario when a configurable product and its associated simple … Read more

Magento: Add Configurable Product Options to Wishlist

This article shows how to add configurable products to wishlist along with their options value. By default, you don’t need to select any configurable product option when you want to add the configurable product to wishlist. But, you will have to select the configurable option while adding the product to cart. So, you might be … Read more

Magento: Filter Configurable Product by Child Product’s Attribute

This article shows how you can filter child products associated with a configurable product by the child product’s attribute value. Suppose, we have a configurable product with two attributes (‘size‘ and ‘color‘) and we want to select only those child products with certain size and/or certain color. Let’s say, we want to select only those … Read more

Magento: Fatal error: Call to a member function getTable() on a non-object

Scenario:- I am getting the fatal error saying:- Fatal error: Call to a member function getTable() on a non-object in /var/www/magento/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php on line 456 This error occurs when I try to browse Configurable product in frontend. Or, when I try to add Configurable product in backend. I am using Magento version 1.5.0.1 Cause & Solution:- … Read more

Magento: How to get all associated children product of a configurable product?

A configurable product can have multiple other products associated to it. This article shows how to fetch all the children products that are associated with a configurable product. Here is the code: /** * Load product by product id */ $product = Mage::getModel('catalog/product') ->load(YOUR_PRODUCT_ID); /** * Get child products id (only ids) */ $childIds = … Read more