| 1 |
<?php |
| 2 |
/** |
| 3 |
* Add Order Details Payment Method Items. |
| 4 |
* |
| 5 |
* @package JupiterX_Core\sellkit |
| 6 |
* @since 1.1.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace Sellkit\Elementor\Modules\Order_Details\Items; |
| 10 |
|
| 11 |
defined( 'ABSPATH' ) || die(); |
| 12 |
|
| 13 |
use Elementor\Plugin as Elementor; |
| 14 |
|
| 15 |
/** |
| 16 |
* Payment Method Item. |
| 17 |
* |
| 18 |
* Initializing the payment method item by extending item base abstract class. |
| 19 |
* |
| 20 |
* @since 1.1.0 |
| 21 |
*/ |
| 22 |
class Payment_Method extends Item_Base { |
| 23 |
|
| 24 |
/** |
| 25 |
* Get Item class postfix. |
| 26 |
* |
| 27 |
* Retrieve the Item class postfix. |
| 28 |
* |
| 29 |
* @since 1.1.0 |
| 30 |
* @access public |
| 31 |
* |
| 32 |
* @return string Item class postfix. |
| 33 |
*/ |
| 34 |
public function get_class_name() { |
| 35 |
return 'payment'; |
| 36 |
} |
| 37 |
/** |
| 38 |
* Get Item type. |
| 39 |
* |
| 40 |
* Retrieve the Item type. |
| 41 |
* |
| 42 |
* @since 1.1.0 |
| 43 |
* @access public |
| 44 |
* |
| 45 |
* @return string Item type. |
| 46 |
*/ |
| 47 |
public function get_type() { |
| 48 |
return 'payment_method'; |
| 49 |
} |
| 50 |
|
| 51 |
/** |
| 52 |
* Add render attribute. |
| 53 |
* |
| 54 |
* Add render attributes for each item based on the settings. |
| 55 |
* |
| 56 |
* @since 1.1.0 |
| 57 |
* @access public |
| 58 |
*/ |
| 59 |
public function add_field_render_attribute() { |
| 60 |
$attributes = [ |
| 61 |
'class' => 'order-details-item-content', |
| 62 |
'id' => 'order-details-' . $this->get_id(), |
| 63 |
]; |
| 64 |
|
| 65 |
$this->widget->add_render_attribute( 'order-details-item-' . $this->get_id(), $attributes ); |
| 66 |
} |
| 67 |
|
| 68 |
/** |
| 69 |
* Render content. |
| 70 |
* |
| 71 |
* Render the item content. |
| 72 |
* |
| 73 |
* @since 1.1.0 |
| 74 |
* @access public |
| 75 |
* @param object $order_data Order data. |
| 76 |
*/ |
| 77 |
public function render_content( $order_data ) { |
| 78 |
?> |
| 79 |
<strong |
| 80 |
<?php |
| 81 |
echo $this->widget->get_render_attribute_string( 'order-details-item-' . esc_attr( $this->get_id() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Elementor-generated attributes. |
| 82 |
?> |
| 83 |
> |
| 84 |
<?php |
| 85 |
echo esc_html( $order_data['payment_method'] ); |
| 86 |
?> |
| 87 |
</strong> |
| 88 |
<?php |
| 89 |
} |
| 90 |
|
| 91 |
/** |
| 92 |
* Render dummy content. |
| 93 |
* |
| 94 |
* Render the Item dummy content. |
| 95 |
* |
| 96 |
* @since 1.1.0 |
| 97 |
* @access public |
| 98 |
*/ |
| 99 |
public function render_dummy_content() { |
| 100 |
?> |
| 101 |
<strong |
| 102 |
<?php |
| 103 |
echo $this->widget->get_render_attribute_string( 'order-details-item-' . esc_attr( $this->get_id() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Elementor-generated attributes. |
| 104 |
?> |
| 105 |
> |
| 106 |
<?php |
| 107 |
echo esc_html__( 'Cash on delivery...( payment method )', 'sellkit' ) |
| 108 |
?> |
| 109 |
</strong> |
| 110 |
<?php |
| 111 |
} |
| 112 |
} |
| 113 |
|