PATH:
home
/
letacommog
/
camarsac
/
wp-content
/
plugins
/
jet-engine
/
includes
/
compatibility
/
packages
<?php /** * Class description * * @package package_name * @author Cherry Team * @license GPL-2.0+ */ // If this file is called directly, abort. if ( ! defined( 'WPINC' ) ) { die; } if ( ! class_exists( 'Jet_Engine_Woo_Package' ) ) { /** * Define Jet_Engine_Woo_Package class */ class Jet_Engine_Woo_Package { /** * Constructor for the class */ public function __construct() { add_filter( 'jet-engine/post-type/product/meta-fields', array( $this, 'product_fields' ) ); add_filter( 'jet-engine/taxonomy/product_cat/meta-fields', array( $this, 'product_cat_fields' ) ); add_action( 'woocommerce_shop_loop', array( $this, 'set_object_on_each_loop_post' ) ); add_filter( 'jet-engine/listings/taxonomies-for-options', array( $this, 'add_visibility_tax' ) ); add_action( 'jet-engine/listing/after-tax-fields', array( $this, 'add_tax_visibility_options' ), 10, 2 ); add_filter( 'jet-engine/listing/grid/tax-query-item-settings', array( $this, 'apply_visibility_terms' ) ); } /** * Apply visibility settings for listing grid widget * * @return [type] [description] */ public function apply_visibility_terms( $settings ) { if ( ! empty( $settings['tax_query_wc_visibility_term'] ) ) { $settings['tax_query_terms'] = $settings['tax_query_wc_visibility_term']; } return $settings; } /** * Add product_visibility to allowed taxonomies to query for * * @param [type] $taxonomies [description] */ public function add_visibility_tax( $taxonomies ) { if ( taxonomy_exists( 'product_visibility' ) ) { $taxonomies['product_visibility'] = __( 'Product Visibility', 'jet-engine' ); } return $taxonomies; } /** * Add taxonomy visibility option * * @param [type] $repeater [description] * @param [type] $widget [description] */ public function add_tax_visibility_options( $repeater, $widget ) { $product_visibility_term_ids = wc_get_product_visibility_term_ids(); $options = array(); foreach ( $product_visibility_term_ids as $term_name => $term_id ) { $options[ $term_id ] = ucfirst( str_replace( array( '_', '-' ), '', $term_name ) ); } $repeater->add_control( 'tax_query_wc_visibility_term', array( 'label' => __( 'WooCommerce Visibility Term', 'jet-engine' ), 'type' => \Elementor\Controls_Manager::SELECT, 'options' => $options, 'default' => '', 'display_block' => true, 'condition' => array( 'type' => 'tax_query', 'tax_query_taxonomy' => 'product_visibility', ), ) ); } /** * Set current product as current listing object for each product loop item */ public function set_object_on_each_loop_post() { if ( jet_engine()->listings ) { global $post; jet_engine()->listings->data->set_current_object( $post ); } } /** * Product fields * * @return array */ public function product_fields( $fields ) { if ( empty( $fields ) ) { $fields = array(); } $fields[] = array( 'name' => '_regular_price', 'type' => 'text', 'title' => __( 'Price', 'jet-engine' ), ); $fields[] = array( 'name' => '_sale_price', 'type' => 'text', 'title' => __( 'Sale Price', 'jet-engine' ), ); $fields[] = array( 'name' => '_sku', 'type' => 'text', 'title' => __( 'SKU', 'jet-engine' ), ); $fields[] = array( 'name' => 'total_sales', 'type' => 'text', 'title' => __( 'Sales', 'jet-engine' ), ); $fields[] = array( 'name' => '_wc_average_rating', 'type' => 'text', 'title' => __( 'Average Rating', 'jet-engine' ), ); $fields[] = array( 'name' => '_stock_status', 'type' => 'text', 'title' => __( 'Stock Status', 'jet-engine' ), ); $fields[] = array( 'name' => '_weight', 'type' => 'text', 'title' => __( 'Weight', 'jet-engine' ), ); $fields[] = array( 'name' => '_length', 'type' => 'text', 'title' => __( 'Length', 'jet-engine' ), ); $fields[] = array( 'name' => '_width', 'type' => 'text', 'title' => __( 'Width', 'jet-engine' ), ); $fields[] = array( 'name' => '_height', 'type' => 'text', 'title' => __( 'Height', 'jet-engine' ), ); return $fields; } /** * Product category fields * * @return array */ public function product_cat_fields( $fields ) { $fields[] = array( 'name' => 'thumbnail_id', 'type' => 'media', 'title' => __( 'Thumbnail', 'jet-engine' ), ); return $fields; } } } new Jet_Engine_Woo_Package();
[+]
..
[-] wcfm.php
[edit]
[-] polylang.php
[edit]
[-] wpml.php
[edit]
[-] meta-box.php
[edit]
[-] elementor-pro.php
[edit]
[-] acf.php
[edit]
[-] woocommerce.php
[edit]
[-] crocoblock-wizard.php
[edit]
[-] jet-popup.php
[edit]
[-] jet-theme-core.php
[edit]
[-] jet-smart-filters.php
[edit]