Magento 2 configurable product options

Overview

Magento 2 Configurable Options

This module provides functionality for preselecting configurable product options and updating attribute values from selected simple product.

Installation

composer require bkozlic/configurable-options

php bin/magento setup:upgrade

Usage

Admin system configuration

Go to Admin Panel -> Stores -> Configuration -> Catalog -> Configurable Options

Option Functionality
Enable Enable or disable complete module functionality.
Simple Product Images Set if images of selected simple products will be prepended to configurable images or they will replace them.
Preselect Product Options Enable or disable option preselect after product page is loaded.
Update Simple Product Attribute Enable or disable update of attribute values for selected simple product.
Attributes Set as many attributes as you want. You need to specify attribute code, html selector where value will be placed and choose if value should be updated asynchronously or not. Works only if previous option is set to "Yes".

Set custom product for preselect

Open configurable product in Admin. Under "Simple Product Preselect" fieldset you can select specific simple product to preselect after product page is loaded.

Modify attribute values

You can use modifier functionality to modify product's attribute value. Take, for example, the product sku. If you want to display sku value with prefix, suffix or something different you can do this.

Add modifier in the di.xml. There is already default modifier in the module which you can take as an example.

Vendor\Module\Model\Modifier\ModifierName 10 ">

    
        
            
                Vendor\Module\Model\Modifier\ModifierName
                10
            
        
    

Sort order defines in which order modifiers from the pool will be executed.

Modifier class must implement \BKozlic\ConfigurableOptions\Model\ModifierInterface

    public function processValue(string $attributeCode, ProductInterface $product, string $cssSelector, $value)
    {
        // Update value
    }

Add custom values

If you want to add value for the products but there is no attribute for it, you can do it with modifier.

  • Add custom non-existing attribute code in the store configuration under Attributes fields.
  • Create a custom modifier class and add it to the di.xml.
  • In the modifier's processValue function check if attribute code is equal to the code you added in configuration and add value you want to display to the frontend.

By default, product name and sku are updated after simple product is preselected.

Recommendations

It is recommended to set async load for attributes with a big values and attributes which will be added in the html element not visible until you scroll.

Prerequisites

  • Magento >= 2.3.2

Developers

You might also like...
Magento 2.4.x module Sort Out Of Stock Product At last the product list

Magento 2.4.x module Sort Out Of Stock Product At last the product list composer require ghoster/module-outofstockatlast Extension on GitHub Direct d

Magento 2 Module that adds Donation Product Type. Enables the customer to add a donation (product) of a preferred amount to the cart.
Magento 2 Module that adds Donation Product Type. Enables the customer to add a donation (product) of a preferred amount to the cart.

Magento 2 Module Experius DonationProduct (RC1.0) Demo website: https://donationproduct.experius.nl Magento Marketplace: https://marketplace.magento.c

A simple mini pos that handles managing product data's and product categories

What is CodeIgniter CodeIgniter is an Application Development Framework - a toolkit - for people who build web sites using PHP. Its goal is to enable

Allow multiple options for Magento 2 checkout layout. Provides capabilities to AB test checkout changes and more.
Allow multiple options for Magento 2 checkout layout. Provides capabilities to AB test checkout changes and more.

Aimes_CheckoutDesigns Features Please note: This module is currently still considered a proof of concept. This module provides the ability to change c

A Magento 2 module that enables configurable CORS Headers on the GraphQL and REST APIs

Magento 2 CORS Magento Version Support Ever try to work with the Magento GraphQL API or REST API from your browser and see the following? Access to XM

Package to send customer specific prices to Magento from a Laravel application using a configurable source.

Laravel Magento Customer Prices This package provides a way to add customer specific prices to Magento from a Laravel app. By default, it uses the Mag

Package to send prices to Magento from a Laravel application using a configurable source.

Laravel Magento Prices Package to send prices to Magento from a Laravel application using a configurable source. Features The idea is that we want to

In order to use the Korean Language on your Magento 2 store, it is time to start with Magento 2 Korean Language Pack in the set of informative documentations by Mageplaza. Magento 2 Korean Language Package is published by Magento 2 Translation Project at Crowdin, so all phrases will be replaced by the Korean language according to the contribution to that project. Please following up the guides in this post to convert the language with ease!
Magento 2 Product Allocation extension allows the to admin manage all products in an order

Magento 2 Product Allocation extension allows the to admin manage all products in an order, making sure that products can only be moved to cart if sufficient allocation is available.

Magento 2 Product PDF/File Attachment FREE Extension
Magento 2 Product PDF/File Attachment FREE Extension

Overview: Magento 2 Product Attachment extension allows attaching additional information such as manuals, warranty, recipes, etc. in different formats

Magento 2 Preview/Visit Catalog allows the store owner to quickly preview the catalog (product & category) pages from the admin panel.
Magento 2 Preview/Visit Catalog allows the store owner to quickly preview the catalog (product & category) pages from the admin panel.

Magento 2 Preview/Visit Catalog Overview Magento 2 Preview/Visit Catalog allows the store owner to quickly preview the catalog (product & category) pa

Boilerplate between the Magento API and ImportExport, so that you can do fast Array/XMLRPC/SOAP based product imports.

Boilerplate between the Magento API and ImportExport, so that you can do fast Array/XMLRPC/SOAP based product imports.

A Magento 2 module that allows for creating discrete PDP (Product Detail Pages) page layouts for customers landing on the site from a PPC (Pay Per Click) link/ad by allowing routing to the same pages using a `/ppc/` prefix in the URL path.
A Magento 2 module that allows for creating discrete PDP (Product Detail Pages) page layouts for customers landing on the site from a PPC (Pay Per Click) link/ad by allowing routing to the same pages using a `/ppc/` prefix in the URL path.

A Magento 2 module that allows for creating discrete PDP (Product Detail Pages) page layouts for customers landing on the site from a PPC (Pay Per Click) link/ad by allowing routing to the same pages using a `/ppc/` prefix in the URL path.

⚙️ A WordPress plugin to set WordPress options from a .env file.

dotenv A WordPress plugin to set WordPress options from a .env file. Any WPENV_ prefixed variables in the .env will be used to override the WordPress

More options when uploading files such as name changes, resizing or compression through TinyPNG.

Kirby Upload Extended More options when uploading files like name changes, resizing via Kirby or compression and optional resizing via TinyPNG. Thanks

A PHP-based sandboxing library with a full suite of configuration and validation options.
A PHP-based sandboxing library with a full suite of configuration and validation options.

A full-scale PHP 5.4+ sandbox class that utilizes PHP-Parser to prevent sandboxed code from running unsafe code. It also utilizes FunctionParser to di

A simple Laravel package for generating download links with options such as expire time, IP restrictions, etc.

Generate download links in your Laravel applications This package allows you to generate download links for files. Once installed you can do stuff lik

PHP library to easily edit image with GD extension. Resize, crop, merge, draw, and many more options !
PHP library to easily edit image with GD extension. Resize, crop, merge, draw, and many more options !

PHP Image Editor PHP library to easily edit image with GD extension. Resize, crop, merge, draw, and many more options ! ✨ Supporting ⭐ Star this repos

A simple laravel package to validate console commands arguments and options.

Command Validator A simple laravel package to validate console commands arguments and options. Installation Require/Install the package using composer

Releases(2.0.0)
Owner
Berin Kozlic
Berin Kozlic
The Laravel eCommerce DHL Shipping module module calculates the shipping rates based on DHL API for product shipping.

Introduction DHL Shipping Add-on provides DHL Shipping methods for shipping the product. It packs in lots of demanding features that allows your busin

Bagisto 1 May 31, 2022
Laravel eCommerce Pre Order Extension allows the customers and guest users to pre-order the upcoming product and out of stock products.

Introduction Bagisto Pre-order add-on allows the customer to pre-order products which are not yet available at the online store. With the help of Bagi

Bagisto 3 May 31, 2022
A Magento 1.9's module to export products informations, inside a chosen date range, to a .XLSX file.

Magento 1.9 Export products module A magento 1.9 module to export products informations to a .XLSX file. Module informations Package/Namespace: "Mathe

Matheus Delazeri 3 Oct 12, 2021
Magento 2 module to only allow checkout when the number of items in the cart are a multiple of X.

Cart Quantity Multiple - Magento 2 Module Introduction This module allows to limit checkout only when the contents of the cart are a multiple of X

ADVOCODO 3 Apr 7, 2022
Example of Pre-Loader Implementation for Magento 2

Example of preloader Implements optimistic preloader for configurable product data without taking into account simple product status for: Price of con

EcomDev B.V. 10 Dec 12, 2021
Magento 2 Facebook Pixel Extension

Magento 2 Facebook Pixel Extension Enable Facebook Pixel on Magento 2 website Requirements Magento Community 2.3.0-2.4.x (CE, EE, ECE, B2B) Magefan Co

Magefan 13 Jul 13, 2022
Magento 2 Module: OrderConfirmationEmailStatus

Magento 2 Module: OrderConfirmationEmailStatus Main Functionalities Installation Main Functionalities This module adds a column in the sales order gri

null 1 Jan 21, 2022
Magento 2 Share Cart extension Free

Mageplaza Share Cart Extension helps customers in sharing their shopping cart with friends and family as well. This is a supportive method to promote store’s conversion rate via the existing users, and this can significantly contribute to the revenue of the store.

Mageplaza 12 Jul 22, 2022
Metamask & web3js Ethereum payment method extenstion for Magento 2 without any third party gateways

CurrencyPrecision Magento 2 Extension Metamask Ethereum payment method module for Magento 2 Table of contents Description Feature Installation Compose

Ihor Oleksiienko 16 Nov 22, 2022
Enhancement to Magento to allow simple product prices to be used instead of the default special-case configurable product prices

Simple Configurable Products Extension For Magento This documentation applies to SCP versions 0.7 onwards. The documentation for SCP v0.6 and earlier

Simon King 288 Nov 7, 2022