Skip to content

javascript

Auto Added by WPeMatico

How to call javascript function from Observer file in Magento 2

I have created a custom js file in my custom module. appcodeVendorModuleviewfrontendlayoutdefault.xml <?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”> <head> <script src=”Vendor_Module::js/test.js”/> </head> appcodeVendorModuleviewfrontendwebjstest.js function Test(json){ console.log(‘Test Web’,json); } Then used add to cart event. appcodeVednorModuleetcevents.xml <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:Event/etc/events.xsd”> <event… Read More »How to call javascript function from Observer file in Magento 2

Owl carousel show double image in responsive settings items:1 in mobile

Owl carousel show double image in responsive settings items:1 in mobile <div class=”owl-carousel owl-theme pt-16 xxl:pt-20 h-full” id=”carousel8″> <div class=”group flex justify-around items-center centerwrap”> <div class=”centerwidth”> <Img class=”object-cover w-full” src=”images/car/carslide1.png”></Img> </div> /* other content stuff */ </div> <div class=”group flex… Read More »Owl carousel show double image in responsive settings items:1 in mobile