From 686c4a7dd29f05b9eb340f2b1459386fe9e6b89d Mon Sep 17 00:00:00 2001 From: Ujwol Bastakoti Date: Fri, 30 Jun 2023 13:04:01 +0545 Subject: [PATCH] Version 2.0.2 --- ctc-lite.php | 7 ++++--- js/ctcl-frontend.js | 17 +++++++++++++++++ readme.txt | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ctc-lite.php b/ctc-lite.php index 4f5051c..5772efd 100644 --- a/ctc-lite.php +++ b/ctc-lite.php @@ -3,7 +3,7 @@ Plugin Name:CT Commerce Lite Plugin URI:https://github.com/ujw0l/ctc-lite Description: CT Commerce Lite ecommerce plugin - Version: 2.0.1 + Version: 2.0.2 Author: Ujwol Bastakoti Author URI:https://ujw0l.github.io/ Text Domain: ctc-lite @@ -200,7 +200,7 @@ public function enequeFrontendJs(){ public function enequeFrontendCss(){ - wp_enqueue_style( 'ctclFrontendCss', CTCL_DIR_PATH.'css/ctcl-frontend.css'); + wp_enqueue_style( 'ctclFrontendCss', CTCL_DIR_PATH.'css/ctcl-frontend.css', array('dashicons')); } /** @@ -237,7 +237,7 @@ public function enequeAdminCss(){ public function requiredShortCode(){ add_shortcode('ctcl_payment_options', array($this->ctclHtml,'paymentOptionsShortCode')); add_shortcode('ctcl_shipping_options', array($this->ctclHtml,'shippingOptionsShortCode')); - // add_shortcode('ctcl_order_page',array($this->ctclProcessing,'orderProcessingShortCode')); + } /** @@ -295,6 +295,7 @@ public function registerGutenbergBlocks(){ wp_register_style( 'ctcl-block-frontend-styles', plugins_url( 'css/ctcl-frontend.css',__FILE__ ), + array('dashicons') ); diff --git a/js/ctcl-frontend.js b/js/ctcl-frontend.js index 324c44c..06d4497 100644 --- a/js/ctcl-frontend.js +++ b/js/ctcl-frontend.js @@ -182,8 +182,15 @@ class ctclMain { } } localStorage.setItem('ctclHiddenCart', JSON.stringify(setCartItems)); + + } + /** + * Set custom event on add remove product + */ + document.dispatchEvent(new CustomEvent("addRemoveProduct", { detail:JSON.parse(localStorage.getItem('ctclHiddenCart')).length })); + })) } @@ -409,11 +416,21 @@ class ctclMain { setItems.splice(i, 1); if (1 <= setItems.length) { localStorage.setItem(hiddenCart, JSON.stringify(setItems)); + /** + * Set custom event on add remove product + */ + document.dispatchEvent(new CustomEvent("addRemoveProduct", { detail: setItems.length})); } else { + /** + * Set custom event on add remove product + */ + document.dispatchEvent(new CustomEvent("addRemoveProduct", { detail: 0})); localStorage.removeItem('ctclHiddenCart'); } conts.map(x => x.parentElement.removeChild(x)); + + this.loadCartItems(); } diff --git a/readme.txt b/readme.txt index 8f082ac..f607575 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.patreon.com/ujw0l/membership Tags: block, ecommerce, store, cart ,sell, shop Requires at least: 5.5.2 Tested up to: 6.2.2 -Stable tag: 2.0.1 +Stable tag: 2.0.2 Requires PHP: 7.4.9 License: GPLv2 or later