The Stack Overflow podcast is back! Listen to an interview with our new CEO.
3

Try Below way.. You can do it with layout <referenceContainer name="before.body.end"> <block class="\Magento\Framework\View\Element\Template" template="You_Module::js.phtml" name="module_js"/> </referenceContainer> and in js.phtml <scrip src="example.com/jp2/test.js" /> Or <reference name="before_body_end">...


3

Override in Theme To override list.html file copy from vendor/magento/module-checkout/view/frontend/web/template/payment-methods/list.html to app/design/frontend/<Vendor>/<Yourtheme>/Magento_Checkout/web/template//payment-methods/list.html Run below command to see the changed php bin/magento setup:upgrade php bin/magento setup:static-...


3

Well, I think there are two ways. Create your own sort option in a module using a plugin. Something like this: Magento 2 How to add custom sort by option. Look at Luca S's answer. I think this person has a general idea of how to do it. Use Position option but modified: http://magento2x.com/magento-sort-newest-products-solution/. Hopefully this will Help ...


3

PWAs/Service workers do require an SSL certificate/HTTPS. You need HTTPS During development you'll be able to use service worker through localhost, but to deploy it on a site you'll need to have HTTPS setup on your server. Using service worker you can hijack connections, fabricate, and filter responses. Powerful stuff. While you would use ...


2

Suppose you have an error in your customer/section/load endpoint. What does return http://your-localhost/customer/section/load ?


2

You could do the following: overwrite a default js file checkout-data-resolver.js add extra lines to the applyBillingAddress function to check if default billing address exists and if true to use it. var config = { map: { '*': { 'Magento_Checkout/js/model/checkout-data-resolver': 'Vendor_Module/js/model/checkout-data-resolver' ...


1

can you try this script. <script type="text/javascript"> require(['jquery', 'jquery/ui'],function($){ jQuery(document).ready(function(){ jQuery('.regular').slick({ dots: true, infinite: true, slidesToShow: 1, slidesToScroll: 1, autoplay:true, ...


1

Add an external JS in the following way : Try this, Add your custom js in the following path. app/design/frontend/Vendor/theme-name/web/js/nameofjs.js then you need to add requirejs-config.js to the following path. app/design/frontend/Vendor/theme-name/requirejs-config.js then add the following code in it var config = { paths: { ...


1

You can create a checkout_index_index.xml in your module or theme, then add it via an uiComponent, as you can see in this example below. <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <...


1

use self under initailize function dont declare it under testfunctionOut initialize: function () { self = this; } testfunctionout: function() { console.log(' in testfunctionout'); self.testfunctionin(); }, testfunctionin: function() { console.log(' in testfunctionin'); }


1

Add define instead of require, <script> define([ "jquery", "mage/translate", "mage/adminhtml/events", "mage/adminhtml/wysiwyg/tiny_mce/setup" ], function(jQuery){ wysiwygCompanyDescription = new wysiwygSetup("company_description", { "width":"...


1

I finally found an answer. It was because I didn't add my dependencies in requirejs file. requirejs-config.js var config = { paths: { custom_js: 'js/custom', }, shim: { custom_js: ['jquery', 'Magento_Customer/js/customer-data'] }, } I still find it strange that Chrome did load the dependencies correctly, but I'm happy I ...


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