Done !
Server IP : 162.0.217.223 / Your IP : 216.73.216.150 Web Server : LiteSpeed System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : mypckeys ( 1539) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mypckeys/yeslicense.org/wp-content/plugins/yaymail/src/Shortcodes/ |
Upload File : |
<?php namespace YayMail\Shortcodes; use YayMail\Utils\Helpers; use YayMail\Utils\SingletonTrait; use YayMail\Abstracts\BaseShortcode; /** * @since 4.0.6 * @method: static RefundShortcodes get_instance() */ class RefundShortcodes extends BaseShortcode { use SingletonTrait; protected function __construct() { $this->available_email_ids = [ 'customer_refunded_order', 'customer_pos_refunded_order' ]; parent::__construct(); } public function get_shortcodes() { $shortcodes = []; $shortcodes[] = [ 'name' => 'yaymail_refund_type', 'description' => __( 'Refund Type', 'yaymail' ), 'group' => 'order_details', 'callback' => [ $this, 'yaymail_refund_type' ], ]; return $shortcodes; } /** * Render order billing shortcode * * @param $args includes * $render_data * $element * $settings * $is_placeholder */ public function yaymail_refund_type( $data ) { $render_data = isset( $data['render_data'] ) ? $data['render_data'] : []; if ( ! empty( $render_data['is_sample'] ) ) { /** * Is sample order */ return __( '(partially) refunded', 'yaymail' ); } $order = Helpers::get_order_from_shortcode_data( $render_data ); if ( empty( $order ) ) { /** * Not having order */ return ''; } return ! empty( $render_data['partial_refund'] ) ? __( 'partially refunded', 'woocommerce' ) : __( 'refunded', 'woocommerce' ); } }