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 } } ...


30

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)


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 ...


29

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)...


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/...


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($...


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 ...


24

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.


23

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 ...


22

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 ...


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 ...


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 ...


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

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);


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="...


16

From the question it is not clear for which version you want to check still I am adding answer, For M2 you can check like this, if($product->getTypeId() == \Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE){ echo "product is configurable"; } Where $product is \Magento\Catalog\Model\Product object For M1 you can check ...


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

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


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 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 = [] ) { ...


14

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


14

catalog_product_super_link table save only Configurable products and its child products relationShip. Where catalog_product_relation save configurable products and its child products relation Ship group products and its child products relationship bundle products and its child products relationship.


14

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() &&...


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 ...


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