New answers tagged

0

Magento usesMagento_Ui/js/form/element/abstract.js as default component for the input fileds. To create a custom component with some default functionality you need to use Abstract component as dependancy define([ 'jquery', 'Magento_Ui/js/form/element/abstract' ], function ($, Abstract) { 'use strict'; return Abstract.extend({ initialize: ...


1

Hello friends I found the issue. jquery was conflicting When I check in console jQuery was undefined I have checked using require but jquery was not worked. require(['jquery'],function($){ console.log($.fn); }); So I have a check-in page source and found that one jquery was added in the head section and it was coming from some custom extension. So I ...


0

I used this for using select attributes: jQuery("#product-options-wrapper .super-attribute-select").click(function() { jQuery('.fotorama').on('fotorama:ready', function (e, fotorama) { fotorama.show(0); }); });


0

The problem is that there are so many asynchronous processes happening on the Magento frontend that it can be very difficult to time a jQuery script appropriately. In you case, your script may be executing before the target element is added to the DOM. If you can determine what component is rendering your target element, you can write a mixin that executes ...


1

Checkout in Magento Luma theme uses uicomponent and knockout technology. jquery will rarely make what you want the ui to do.. All uicomponents have paths and these are visible in the registry. the idea is to find the input path in the registry. An example below and I put a public repository for you to get a full working example too. toggleCompanyField: ...


0

I would do this way: In your observer add the data to session. use Magento\Customer\Model\Session $this->customerSession->setMyData($json) And in my default.xml <referenceContainer name="before.body.end"> <block class="NameSpace\ModuleName\View\Element\Template" name="my.before.end" template="...


0

You can use JQuery using requirejs as below. require(['jquery'], function ($) { $('.customdrop select').on('change',function(){ console.log($('.customdrop select').find(":selected").text)); if ($('.customdrop select').find(":selected").text()==='Other'){ $('.customfields').show(); } else { ...


Top 50 recent answers are included