|
| 1 | +# Widget Promotions |
| 2 | + |
| 3 | +<Badge type="tip" vertical="top" text="Elementor Core" /> <Badge type="warning" vertical="top" text="Intermediate" /> |
| 4 | + |
| 5 | +<img :src="$withBase('/assets/img/elementor-widget-promotion.png')" alt="Elementor Widget Promotion" style="float: right; width: 300px; margin-left: 20px; margin-bottom: 20px;"> |
| 6 | + |
| 7 | +Elementor widgets have two builtin location in the widget panel for promotions and upsells. |
| 8 | + |
| 9 | +The first option is a simple "Need Help?" url which is an external link with general information about the widget. |
| 10 | + |
| 11 | +The second option is a call-to-action area with offers to upgrade to premium widgets/products/services. |
| 12 | + |
| 13 | +## Widget Help URL |
| 14 | + |
| 15 | +Help links displayed at the bottom of the widget panel bellow all the sections. This is a builtin feature providing the user consistent user experience across all Elementor widgets. |
| 16 | + |
| 17 | +Each widget have the option to set an external link containing general information about that specific widget and instruction how to use it. |
| 18 | + |
| 19 | +```php |
| 20 | +class Elementor_Test_Widget extends \Elementor\Widget_Base { |
| 21 | + |
| 22 | + public function get_custom_help_url() { |
| 23 | + return 'https://example.com/widget-name'; |
| 24 | + } |
| 25 | + |
| 26 | +} |
| 27 | +``` |
| 28 | + |
| 29 | +## Widget Promotion |
| 30 | + |
| 31 | +Promotions are a way for freemium plugins to offer upsells to upgrade to premium widgets/products/services. Widget promotions displayed at the bottom of the widget panel. |
| 32 | + |
| 33 | +```php |
| 34 | +class Elementor_Test_Widget extends \Elementor\Widget_Base { |
| 35 | + |
| 36 | + protected function get_upsale_data() { |
| 37 | + return [ |
| 38 | + 'condition' => ! \Elementor\Utils::has_pro(), |
| 39 | + 'image' => esc_url( ELEMENTOR_ASSETS_URL . 'images/go-pro.svg' ), |
| 40 | + 'image_alt' => esc_attr__( 'Upgrade', 'textdomain' ), |
| 41 | + 'title' => esc_html__( 'Promotion heading', 'textdomain' ), |
| 42 | + 'description' => esc_html__( 'Get the premium version of the widget and grow your website capabilities.', 'textdomain' ), |
| 43 | + 'upgrade_url' => esc_url( 'https://example.com/upgrade-to-pro/' ), |
| 44 | + 'upgrade_text' => esc_html__( 'Upgrade Now', 'textdomain' ), |
| 45 | + ]; |
| 46 | + } |
| 47 | + |
| 48 | +} |
| 49 | +``` |
| 50 | + |
| 51 | +This is the place to emphasize that the promotion is set on a specific widget. It allows addon developers to create a custom CTA to promote a premium version of that widget. |
| 52 | + |
| 53 | +There is an option to conditionally hide/display this promotion if some conditions are met. For example, Elementor uses widget promotions only when Elementor Pro is not active, therefore paying customers don't see widget promotions. |
0 commit comments