This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// Main function | |
// has to be added to wc-yotpo-settings.php | |
function wc_yotpo_get_orderstatus($setting) { | |
// $setting is current order status as saved in the settings | |
$statuses = wc_get_order_statuses(); | |
if (!array_key_exists($setting,$statuses)) { | |
wc_yotpo_display_message('Warning - The current Custom Order Status setting ('.$setting.') does <strong>NOT</strong> exist in your WooCommerce instance. <br>It is recommended that you update your settings to avoid missing orders!', true); | |
} elseif (is_null($setting) || empty($setting)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use | |
$data['order_date'] = date('Y-m-d H:i:s', strtotime($order->get_date_created())); | |
// instead of | |
$data['order_date'] = $order->get_date_created(); |
NewerOlder