swissup/module-breeze-webkul-order-by-whatsapp-bot

WebkulOrderByWhatsapp integration

Installs: 11

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Open Issues: 0

Language:JavaScript

Type:magento2-module

1.0.1 2024-07-12 09:46 UTC

This package is auto-updated.

Last update: 2024-12-12 10:36:22 UTC


README

Tested with Webkul_OrderByWhatsappBot 5.0.4

Installation

composer require swissup/module-breeze-webkul-order-by-whatsapp-bot
bin/magento module:enable Swissup_BreezeWebkulOrderByWhatsappBot

Required patches

Webkul/OrderByWhatsappBot/view/frontend/web/js/view/product-view-button.js

@@ -27,6 +27,7 @@
     return Component.extend({
         defaults: {
+            popUp: null,
             template: 'Webkul_OrderByWhatsappBot/whatsapp-button',
             shippingFormTemplate: 'Webkul_OrderByWhatsappBot/shipping-address/form',
             buttonText: window.whatsappConfig.pageViewButtonTitle,
@@ -55,7 +55,7 @@
             var self = this;
             this._super();

-            this.isFormPopUpVisible.subscribe(function(value) {
+            this.isFormPopUpVisibleSubscriber = this.isFormPopUpVisible.subscribe(function(value) {
@@ -149,7 +150,7 @@
             var self = this,
                 buttons;

-            if (!popUp) {
+            if (!this.popUp) {
                 buttons = this.popUpForm.options.buttons;
                 this.popUpForm.options.buttons = [{
                         text: buttons.save.text ? buttons.save.text : $t('Save Address'),
@@ -174,10 +175,10 @@
                 this.popUpForm.options.keyEventHandlers = {
                     escapeKey: this.onClosePopUp.bind(this)
                 };
-                popUp = modal(this.popUpForm.options, $(this.popUpForm.element));
+                this.popUp = modal(this.popUpForm.options, $(this.popUpForm.element));
             }

-            return popUp;
+            return this.popUp;
         },

Webkul/OrderByWhatsappBot/view/frontend/web/js/view/cart/whatsapp-checkout.js

@@ -26,6 +26,7 @@
     var popUp = null;
     return Component.extend({
         defaults: {
+            popUp: null,
             template: 'Webkul_OrderByWhatsappBot/whatsapp-cart-page',
             shippingFormTemplate: 'Webkul_OrderByWhatsappBot/shipping-address/form',
             buttonText: $t('Buy Now'),
@@ -53,7 +54,7 @@
             var self = this;
             this._super();

-            this.isFormPopUpVisible.subscribe(function(value) {
+            this.isFormPopUpVisibleSubscriber = this.isFormPopUpVisible.subscribe(function(value) {
                 if (value) {
                     self.getPopUp().openModal();
                 }
@@ -136,7 +137,7 @@
             var self = this,
                 buttons;

-            if (!popUp) {
+            if (!this.popUp) {
                 buttons = this.popUpForm.options.buttons;
                 this.popUpForm.options.buttons = [{
                         text: buttons.save.text ? buttons.save.text : $t('Save Address'),
@@ -159,10 +160,10 @@
                 this.popUpForm.options.keyEventHandlers = {
                     escapeKey: this.onClosePopUp.bind(this)
                 };
-                popUp = modal(this.popUpForm.options, $(this.popUpForm.element));
+                this.popUp = modal(this.popUpForm.options, $(this.popUpForm.element));
             }

-            return popUp;
+            return this.popUp;
         },