32

I wrote the module based on Fabian Schmengler's solution. This works for me on Magento 2.1.3. /app/code/YourVendor/YourModule/view/frontend/requirejs-config.js var config = { config: { mixins: { 'Magento_ConfigurableProduct/js/configurable': { 'YourVendor_YourModule/js/model/skuswitch': true } } ...


29

The question is tagged with ce-1.7.0.2 but for future reference, if you are using ce-1.9.1.0 ee-1.14.1 or higher, the feature is already built in, with the so-called Configurable Swatches which allow "Product Image Swap". You can enable this feature in System > Configuration > CATALOG > Configurable Swatches Product Image Swap The following ...


28

Copy the folder app/design/frontend/RWD/default/template/configurableswatches/ and its content to app/design/frontend/DEFAULT/default/template/ (or your package template folder) Copy the file app/design/frontend/RWD/default/template/catalog/product/view/type/options/configurable.phtml to app/design/frontend/DEFAULT/default/template/catalog/product/...


28

For getting the parent product id in your phtml file, you can call code directly by: $productId = 52; //this is child product id $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product = $objectManager->create('Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable')->getParentIdsByChild($productId)...


27

To get the tax rate you need to perform a tax request. That can be done with the following code. $store = Mage::app()->getStore('default'); $taxCalculation = Mage::getModel('tax/calculation'); $request = $taxCalculation->getRateRequest(null, null, null, $store); $taxClassId = $product->getTaxClassId(); $percent = $taxCalculation->getRate($...


27

You can do it only direct in DB. For example with query update catalog_product_entity set type_id = 'simple' where type_id = 'virtual'; But beware, this query converts all virtual products to simple. (better to create db backup before start)


26

This code tested on Magento 2.1.4. All you need is in getConfigurableOptions call. 67 - is a test product ID. In my installation that is a configurable product id. Change it to your product id. Copy paste it to testfile.php and run php config.php inside magento root: <?php use Magento\Framework\App\Bootstrap; require __DIR__ . '/app/bootstrap.php'; $...


25

Note: It has been brought to my attention that this solution does not work for Magento 1.9.2. In order to save others wasted time I'd like to point this out at the top of this post. If I develop my own solution or find someone else's solution that works for 1.9.2 I will update this post at that time. Notice: The solution laid out here extends a block class ...


21

The table catalog_product_super_link but the other tables that start with catalog_product_super_ are involved in the relation. catalog_product_super_attribute - holds the configurable attributes catalog_product_super_attribute_label - holds the store view labels for the configurable attributes - this is not that important ...


21

Maybe this helps somebody who looks it up. If you create product configurations and dont add weight to the generated products they will be virtual. If you add weight they will be simple products. If you want to change a single virtual product to a simple product, give the product a weight in the backend and change it to "this product has weight". However ...


21

You have to do setting from admin panel. GO to Admin panel, Stores -> Configuration -> Sales -> Checkout -> Shopping Cart -> Configurable Product Image Set Product Thumbnail itself from dropdown list. Save Confiration.


18

When you create a configurable product it doesn't matter what's the price of simple products -- these prices are ignored completely. So if you want to sell a simple product A which has price $29.99 and a simple product B ($39.99) then you must create a configurable product, set its price to $29.99 and open Associated product tab. Add products you want to ...


18

For Dropdown: Override this file to your theme: vendor/magento/module-configurable-product/view/frontend/web/js/configurable.js your theme file location will be: app/design/frontend/[vendor]/[theme]/Magento_ConfigurableProduct/web/js/configurable.js Replace the _fillSelect method under configurable.js _fillSelect: function (element) { var ...


17

It's a fair amount of work to implement that yourself, but there are a number of extensions that implement that, both free and commercial. SCP is probably the most prominent free extension, and it works well if the theme templates haven't diverged too far from the default. http://www.magentocommerce.com/magento-connect/simple-configurable-products.html ...


17

So, I use the code below in combination with an extension like organic internet simple configurable products. The code below is meant for the cart/checkout process, essentially, it's an update to the configurable price model that passes price calculation to a simple product in the event the product has been added to the cart --- this solution DOES NOT ...


17

You have to make plugin for that to display max price inside detail page, Below is step by step module for your need, Filepath, app/code/Vendor/Modulename/ Registration file, app/code/Vendor/Modulename/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, '...


16

You need to pluginize getProductPrice method. SR/Stackexchange/etc/frontend/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Block\Product\ListProduct"> <plugin name="...


15

Here is what seams to work for me for to remove an attribute from the configurable product. This is the scenario. All the configurable products were created wrong with the attribute brand as a configurable attribute for about 50 configurable products having about 200 simple associated products. All the simple products associated to a configurable attribute ...


15

This is not a full answer but could be a nudge in the right direction. You can autoselect configurable product options using an url hash. Take a look for example here: http://demo.magentocommerce.com/men/new-arrivals/linen-blazer.html#92=22&180=77 If you add #attribute_id=value_id to the URL Magento will select automatically the options you specify. ...


15

I did that once for Magento 2.0, don't have the code available but can show you where you need to make changes: Write a Plugin for Magento\ConfigurableProduct\Block\Product\View\Type\Configurable::getJsonConfig() and add the SKUs to the result: $config['skus'] = []; foreach ($subject->getAllowProducts() as $simpleProduct) { $config['skus'][$...


15

Two Points you need to check for this: Scope of attribute is Global. It should be assigned to Attribute Set. Hope this solved the error. (For my case i missed Point 2, Now it is imported successfully !!!)


14

You do not set the weight before generation of children's products. Depending on this field the Magento decides what type of product is created


13

Try this approach. use the config array that the attribute dropdowns use to change the price of the configurable product. Let's assume that $productId is the ID of the configurable product. $product = Mage::getModel('catalog/product')->load($productId); $block = Mage::app()->getLayout()->createBlock('catalog/product_view_type_configurable'); $...


13

After asking around this are the reasons I've got. Hope its satisfying for you, even though its probably what you expected. The adminhtml interface was made with the intention to make it hard for merchants to totally screw up. For that reason many features that are provided by Magento as a Framework are not possible through the user interface. The ...


13

Here is how you can get the prices of the simple products. The example is for a single configurable product but you can integrate it in your loop. There may be a problem with performance because there are a lot of foreach loops but at least you have a place to start. You can optimize later. //the configurable product id $productId = 126; //load the ...


13

I have preferred to add groupByAttribute for single list of color $ids=Mage::getResourceSingleton('catalog/product_type_configurable') ->getChildrenIds($parentId); $_subproducts = Mage::getModel('catalog/product')->getCollection() ->addIdFilter ($ids) ->addAttributeToSelect('color')-> groupByAttribute('color');


13

You can call it's in block file, Magento specific way by, protected $_catalogProductTypeConfigurable; public function __construct( \Magento\Catalog\Block\Product\Context $context, //for getting parent id of simple \Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable $catalogProductTypeConfigurable, array $data = [] ) { ...


13

Try with $product->getTypeInstance()->getUsedProducts($product).


13

Instead of getData() you need to use getAttributeText('attribute_code') for dropdown attributes. like $_product->getAttributeText('material'); For multi-select try this : $result = $_product->getResource()->getAttribute('material')->getFrontend()->getValue($_product);


13

Found solution here : https://github.com/magento/magento2/issues/7624 Copy final_price.phtml from Vendor/magento/module-configurable-product/view/base/templates/product/price/final_price.phtml to Vendor/theme/Magento_ConfigurableProduct/templates/product/price/final_price.phtml change (around line 22) <?php if (!$block->isProductList() &&...


Only top voted, non community-wiki answers of a minimum length are eligible