Skip to content

Commit

Permalink
Version 2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ujwol Bastakoti authored and Ujwol Bastakoti committed Jun 30, 2023
1 parent 2a62836 commit 686c4a7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
7 changes: 4 additions & 3 deletions ctc-lite.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'));
}

/**
Expand Down Expand Up @@ -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'));

}

/**
Expand Down Expand Up @@ -295,6 +295,7 @@ public function registerGutenbergBlocks(){
wp_register_style(
'ctcl-block-frontend-styles',
plugins_url( 'css/ctcl-frontend.css',__FILE__ ),
array('dashicons')

);

Expand Down
17 changes: 17 additions & 0 deletions js/ctcl-frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }));

}))

}
Expand Down Expand Up @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 686c4a7

Please sign in to comment.