| 1 |
<?php |
| 2 |
/** |
| 3 |
* Base class for Checkout builder widgets. |
| 4 |
* |
| 5 |
* @package King_Addons |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace King_Addons; |
| 9 |
|
| 10 |
use Elementor\Widget_Base; |
| 11 |
|
| 12 |
if (!defined('ABSPATH')) { |
| 13 |
exit; |
| 14 |
} |
| 15 |
|
| 16 |
/** |
| 17 |
* Provides checkout context utilities. |
| 18 |
*/ |
| 19 |
abstract class Abstract_Checkout_Widget extends Widget_Base |
| 20 |
{ |
| 21 |
/** |
| 22 |
* Render placeholder when checkout context is missing. |
| 23 |
* |
| 24 |
* @return void |
| 25 |
*/ |
| 26 |
protected function render_missing_checkout_notice(): void |
| 27 |
{ |
| 28 |
if (!\Elementor\Plugin::$instance->editor->is_edit_mode()) { |
| 29 |
return; |
| 30 |
} |
| 31 |
|
| 32 |
echo '<div class="king-addons-woo-builder-notice">' . esc_html__('This widget works only on the WooCommerce checkout page.', 'king-addons') . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 33 |
} |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|