config.php
80 lines
| 1 | <?php |
| 2 | namespace ShopPress\Elementor\Widgets; |
| 3 | |
| 4 | use ShopPress\Elementor\ShopPressWidgets; |
| 5 | use Elementor\Controls_Manager; |
| 6 | |
| 7 | defined( 'ABSPATH' ) || exit; |
| 8 | |
| 9 | class Content extends ShopPressWidgets { |
| 10 | |
| 11 | public function get_name() { |
| 12 | return 'sp-content'; |
| 13 | } |
| 14 | |
| 15 | public function get_title() { |
| 16 | return __( 'Product Description', 'shop-press' ); |
| 17 | } |
| 18 | |
| 19 | public function get_icon() { |
| 20 | return 'sp-widget sp-eicon-product-content'; |
| 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-product-content-wrapper', |
| 37 | 'wrapper' => '{{WRAPPER}}', |
| 38 | ), |
| 39 | ) |
| 40 | ); |
| 41 | |
| 42 | $this->register_group_styler( |
| 43 | 'content', |
| 44 | __( 'Content', 'shop-press' ), |
| 45 | array( |
| 46 | 'content' => array( |
| 47 | 'label' => esc_html__( 'Content', 'shop-press' ), |
| 48 | 'type' => 'styler', |
| 49 | 'selector' => '.sp-product-content', |
| 50 | 'wrapper' => '{{WRAPPER}}', |
| 51 | ), |
| 52 | ) |
| 53 | ); |
| 54 | } |
| 55 | |
| 56 | protected function register_controls() { |
| 57 | $this->setup_styling_options(); |
| 58 | |
| 59 | do_action( 'shoppress/elementor/widget/register_controls_init', $this ); |
| 60 | } |
| 61 | |
| 62 | protected function render() { |
| 63 | do_action( 'shoppress/widget/before_render', $this->get_settings_for_display() ); |
| 64 | |
| 65 | if ( $this->editor_preview() ) { |
| 66 | sp_load_builder_template( 'single-product/product-content' ); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | protected function content_template() { |
| 71 | ?> |
| 72 | <div class="sp-product-content-wrapper"> |
| 73 | <p class="sp-product-content"> |
| 74 | Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. |
| 75 | </p> |
| 76 | </div> |
| 77 | <?php |
| 78 | } |
| 79 | } |
| 80 |