controlaltdelete/swatches-sku

Installs: 184

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 1

Forks: 1

Open Issues: 0

Language:JavaScript

Type:magento2-module

v1.0.0 2023-01-25 14:40 UTC

This package is auto-updated.

Last update: 2024-11-25 18:56:09 UTC


README

Description

This module allows you to retrieve the SKU of the current selected SKU.

Usage

Require it in your component:

define([
    'uiComponent',
    'ControlAltDelete_SwatchesSku/js/model/selected-product-sku',
], function (
    Component,
    sku
) {
    'use strict';

    return Component.extend({
        sku: sku
    });
});

And then in your HTML:

<!-- Output the selected SKU -->
<span data-bind="text: sku"></span>

But you can also use it with computed observables:

var result = ko.computed( function () {
    return 'The selected SKU is ' + sku();
});

Contribution

Any contribution is highly appreciated. The best way to contribute code is to open a pull request on GitHub.

Licence

OSL - Open Software Licence 3.0

Copyright

(c) Control Alt Delete