Plugin Directory

Changeset 3137039


Ignore:
Timestamp:
08/17/2024 01:39:12 PM (20 months ago)
Author:
website366
Message:

#Cap nhat widget product price

Location:
wpshare247-elementor-addons/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wpshare247-elementor-addons/trunk/inc/helper.php

    r2851642 r3137039  
    77
    88    public function __construct() {
     9       
    910    }
    1011
  • wpshare247-elementor-addons/trunk/inc/woocommerce.php

    r2851642 r3137039  
    1111
    1212    public function init(){
     13        add_action('init', array($this, 'register_ea_session'));
     14        add_action( 'wp_footer', array($this, 'product_session'), 99999);
     15
    1316        add_action( 'woocommerce_before_shop_loop_item_title', [$this, 'woocommerce_img_wrapper_begin'], 9 );
    1417        add_action( 'woocommerce_shop_loop_item_title', [$this, 'woocommerce_img_wrapper_end'], 9 );
    1518        add_action( 'woocommerce_after_shop_loop_item', [$this, 'loop_add_to_cart_wrapper_begin'], 9 );
    1619        add_action( 'woocommerce_after_shop_loop_item', [$this, 'loop_add_to_cart_wrapper_end'], 11 );
     20    }
     21
     22    static function register_ea_session(){
     23      if( !session_id() ){
     24            session_start();
     25        }
     26     }
     27
     28    static function product_session(){
     29        global $product;
     30        if( is_object($product) && is_product()){
     31            $pid = $product->get_id();
     32            $_SESSION['ea_product_id'] = $pid;
     33        }
     34    }
     35
     36    static function get_product(){
     37        $ea_product_id = $_SESSION['ea_product_id'];
     38        $product = wc_get_product( $ea_product_id );
     39        return $product;
    1740    }
    1841
  • wpshare247-elementor-addons/trunk/includes/plugin.php

    r2856412 r3137039  
    235235                            'wpshare247_product_categories_widget',
    236236                            'wpshare247_contact_form7',
    237                             'wpshare247_countdown'
     237                            'wpshare247_countdown',
     238                            'wpshare247_product_single_price_widget'
    238239                            //'wpshare247_new_widget'
    239240                        );
  • wpshare247-elementor-addons/trunk/readme.txt

    r2856412 r3137039  
    44Tags: elementor, carousel, slider, blog, post, page, post type, product, category, list, addon, widget, contact form 7, countdown
    55Requires at least: 4.9
    6 Tested up to: 6.1.1
     6Tested up to: 6.6.1
    77Requires PHP: 7.0
    8 Stable tag: 1.0.0
     8Stable tag: 2.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1212Widgets (Wpshare247 Addons) for Elementor. Wpshare247 Addons for Elementor plugin includes widgets and addons like Blog Post, Products, Post, Page and Custom Post Type Grid or Carousel, Countdown, Contact Form 7.
    1313
    14 Cung cấp các Widget, Addon hỗ trợ Elementor. Có các dạng danh sách như List, Carousel, Slider, Countdown, Contact Form 7.. được phát triển bởi WPSHARE247.COM
     14Cung cấp các Widget, Addon hỗ trợ Elementor. Có các dạng danh sách như List, Carousel, Slider, Countdown, Contact Form 7, WooCommerce.. được phát triển bởi WPSHARE247.COM
    1515
    1616== Description ==
     
    5050* Add new widget: Countdown
    5151
     52= 2.1 =
     53
     54*  Add new widget: Product price
     55
     56
    5257== Upgrade Notice ==
    5358
  • wpshare247-elementor-addons/trunk/wpshare247-elementor-addon.php

    r2856412 r3137039  
    33 * Plugin Name: WPSHARE247 Elementor Addons
    44 * Plugin URI: https://wpshare247.com/
    5  * Description: Widgets (Wpshare247 Addons) for Elementor. Wpshare247 Addons for Elementor plugin includes widgets and addons like Blog Post, Products, Post, Page and Custom Post Type Grid or Carousel, Countdown, Contact Form 7.
    6  * Version: 1.0.1
     5 * Description: Widgets (Wpshare247 Addons) for Elementor. Wpshare247 Addons for Elementor plugin includes widgets and addons like Blog Post, Products, Post, Page and Custom Post Type Grid or Carousel, Countdown, Contact Form 7, WooCommerce Product Price.
     6 * Version: 2.1
    77 * Author: Wpshare247.com
    88 * Author URI: https://wpshare247.com/chuyen-muc/elementor
     
    2222
    2323    require_once( __DIR__ . '/inc/helper.php' );
    24     require_once( __DIR__ . '/inc/woocommerce.php' );
     24
     25    include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
     26    if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
     27        require_once( __DIR__ . '/inc/woocommerce.php' );
     28    }
    2529
    2630    // Load plugin file
Note: See TracChangeset for help on using the changeset viewer.