Here i have a requirement to build SKU. Basing on category,subcategory & brand. Rule is to con-cat 1st 3 chars of categories and subcategories and brand followed by DB increment number. At the movement data entry guy is manually entering SKU. which i have to automate.
Below are the screen shots for understanding.
Usualy in normal java script i would have simply call category element and concat it. But in knowckoutjs i am clue less.when i see inspect elements it has data-bind.
<input class="admin__control-text" type="text" data-bind="
event: {change: userChanges},
value: value,
hasFocus: focused,
valueUpdate: valueUpdate,
attr: {
name: inputName,
placeholder: placeholder,
'aria-describedby': noticeId,
id: uid,
disabled: disabled
}" name="product[sku]" placeholder="" aria-describedby="notice-VCC6U0W" id="VCC6U0W">
i have tried pulling value using below code.i have placed below code in one of the common pages wizard.phtml.
function AppViewModel() {
this.value = ko.observable("Enter String");
}, this);
}
// Activates knockout.js
ko.applyBindings(new AppViewModel());
any one help me in concatenating product categories.thanks in advance.
require([ 'jquery' ], function ($) { $(document).ready(function() { alert('hii'); }); });