config.php
69 lines
| 1 | <?php |
| 2 | namespace ShopPress\Elementor\Widgets; |
| 3 | |
| 4 | defined( 'ABSPATH' ) || exit; |
| 5 | |
| 6 | use ShopPress\Elementor\ShopPressWidgets; |
| 7 | use Elementor\Controls_Manager; |
| 8 | |
| 9 | class Meta extends ShopPressWidgets { |
| 10 | |
| 11 | public function get_name() { |
| 12 | return 'sp-product-meta'; |
| 13 | } |
| 14 | |
| 15 | public function get_title() { |
| 16 | return __( 'Product Meta', 'shop-press' ); |
| 17 | } |
| 18 | |
| 19 | public function get_icon() { |
| 20 | return 'sp-widget sp-eicon-product-categories'; |
| 21 | } |
| 22 | |
| 23 | public function get_categories() { |
| 24 | return array( 'sp_woo_single' ); |
| 25 | } |
| 26 | |
| 27 | public function setup_styling_options() { |
| 28 | |
| 29 | $this->register_group_styler( |
| 30 | 'wrapper', |
| 31 | __( 'Wrapper', 'shop-press' ), |
| 32 | array( |
| 33 | 'wrapper' => array( |
| 34 | 'label' => esc_html__( 'Wrapper', 'shop-press' ), |
| 35 | 'type' => 'styler', |
| 36 | 'selector' => '.sp-pr-meta', |
| 37 | 'wrapper' => '{{WRAPPER}}', |
| 38 | ), |
| 39 | ) |
| 40 | ); |
| 41 | } |
| 42 | |
| 43 | protected function register_controls() { |
| 44 | $this->setup_styling_options(); |
| 45 | |
| 46 | do_action( 'shoppress/elementor/widget/register_controls_init', $this ); |
| 47 | } |
| 48 | |
| 49 | protected function render() { |
| 50 | do_action( 'shoppress/widget/before_render', $this->get_settings_for_display() ); |
| 51 | |
| 52 | if ( $this->editor_preview() ) { |
| 53 | sp_load_builder_template( 'single-product/product-meta' ); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | protected function content_template() { |
| 58 | ?> |
| 59 | <div class="sp-pr-meta"> |
| 60 | <div class="product_meta"> |
| 61 | <span class="sku_wrapper">SKU: <span class="sku">woo-album</span></span> |
| 62 | <span class="posted_in">Category: <a href="#" rel="tag">Clothing</a></span> |
| 63 | <span class="tagged_as">Tag: <a href="#" rel="tag">Tshirts</a></span> |
| 64 | </div> |
| 65 | </div> |
| 66 | <?php |
| 67 | } |
| 68 | } |
| 69 |