ProductDocument.php
90 lines
| 1 | <?php |
| 2 | namespace SureCart\Integrations\Elementor\Documents; |
| 3 | |
| 4 | use \ElementorPro\Modules\ThemeBuilder\Documents\Single_Base; |
| 5 | |
| 6 | if ( ! defined( 'ABSPATH' ) ) { |
| 7 | exit; // Exit if accessed directly |
| 8 | } |
| 9 | |
| 10 | /** |
| 11 | * Elementor page library document. |
| 12 | * |
| 13 | * Elementor page library document handler class is responsible for |
| 14 | * handling a document of a page type. |
| 15 | * |
| 16 | * @since 2.0.0 |
| 17 | */ |
| 18 | class ProductDocument extends Single_Base { |
| 19 | |
| 20 | /** |
| 21 | * Get document properties. |
| 22 | * |
| 23 | * Retrieve the document properties. |
| 24 | * |
| 25 | * @return array Document properties. |
| 26 | */ |
| 27 | public static function get_properties() { |
| 28 | $properties = parent::get_properties(); |
| 29 | |
| 30 | $properties['location'] = 'single'; |
| 31 | $properties['condition_type'] = 'surecart'; |
| 32 | |
| 33 | return $properties; |
| 34 | } |
| 35 | |
| 36 | |
| 37 | /** |
| 38 | * Get document name. |
| 39 | * |
| 40 | * @return string Document name. |
| 41 | */ |
| 42 | public static function get_type() { |
| 43 | return 'surecart-product'; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Get document title. |
| 48 | * |
| 49 | * @return string Document title. |
| 50 | */ |
| 51 | public static function get_title() { |
| 52 | return esc_html__( 'SureCart Product', 'elementor-pro' ); |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Get document plural title. |
| 57 | * |
| 58 | * @return string Document plural title. |
| 59 | */ |
| 60 | public static function get_plural_title() { |
| 61 | return esc_html__( 'SureCart Products', 'elementor-pro' ); |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Get document icon. |
| 66 | * |
| 67 | * @return string Document icon. |
| 68 | */ |
| 69 | protected static function get_site_editor_icon() { |
| 70 | return 'eicon-single-product'; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Get document tooltip data. |
| 75 | * |
| 76 | * Retrieve the document tooltip data. |
| 77 | * |
| 78 | * @return array Document tooltip data. |
| 79 | */ |
| 80 | protected static function get_site_editor_tooltip_data() { |
| 81 | return [ |
| 82 | 'title' => esc_html__( 'What is a Single Product Template?', 'elementor-pro' ), |
| 83 | 'content' => esc_html__( 'A single product template allows you to easily design the layout and style of SureCart single product pages, and apply that template to various conditions that you assign.', 'elementor-pro' ), |
| 84 | 'tip' => esc_html__( 'You can create multiple single product templates, and assign each to different types of products, enabling a custom design for each group of similar products.', 'elementor-pro' ), |
| 85 | 'docs' => 'https://go.elementor.com/app-theme-builder-product', |
| 86 | 'video_url' => 'https://www.youtube.com/embed/PjhoB1RWkBM', |
| 87 | ]; |
| 88 | } |
| 89 | } |
| 90 |