Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
2.2 kB
5
Indexable
Never
add_action('marketking_order_after_order_information', function(){

	$order_id = sanitize_text_field(marketking()->get_pagenr_query_var());
	$orderobj = wc_get_order($order_id);
	?>
	<div >
	    <span class="dot bg-warning d-mb-none"></span>
	    <?php
	    $status = $orderobj->get_status();
	    $statustext = $badge = '';
	    if ($status === 'processing'){
	        $badge = 'badge-success';
	        $statustext = esc_html__('Processing','marketking-multivendor-marketplace-for-woocommerce');
	    } else if ($status === 'on-hold'){
	        $badge = 'badge-warning';
	        $statustext = esc_html__('On Hold','marketking-multivendor-marketplace-for-woocommerce');
	    } else if (in_array($status,apply_filters('marketking_earning_completed_statuses', array('completed')))){
	        $badge = 'badge-info';
	        $statustext = esc_html__('Completed','marketking-multivendor-marketplace-for-woocommerce');
	    } else if ($status === 'refunded'){
	        $badge = 'badge-gray';
	        $statustext = esc_html__('Refunded','marketking-multivendor-marketplace-for-woocommerce');
	    } else if ($status === 'cancelled'){
	        $badge = 'badge-gray';
	        $statustext = esc_html__('Cancelled','marketking-multivendor-marketplace-for-woocommerce');
	    } else if ($status === 'pending'){
	        $badge = 'badge-dark';
	        $statustext = esc_html__('Pending Payment','marketking-multivendor-marketplace-for-woocommerce');
	    } else if ($status === 'failed'){
	        $badge = 'badge-danger';
	        $statustext = esc_html__('Failed','marketking-multivendor-marketplace-for-woocommerce');
	    } else {
	        // custom status
	        $badge = apply_filters('marketking_custom_status_badge', 'badge-gray', $status);
	        $wcstatuses = wc_get_order_statuses();
	        if (isset($wcstatuses['wc-'.$status])){
	            $statustext = $wcstatuses['wc-'.$status];
	        } else {
	            $statustext = '';
	        }
	        $statustext = apply_filters('marketking_custom_status_text', $statustext, $status);
	    }

	    ?>
	    <span class="badge badge-sm badge-dot has-bg <?php echo esc_attr($badge);?> d-none d-mb-inline-flex"><?php
	    echo esc_html($statustext);
	    ?></span>
	</div>

	<?php
});