Skip to content

Instantly share code, notes, and snippets.

View hxii's full-sized avatar
🛠️
Coming up with more things

Paul (hxii) Glushak hxii

🛠️
Coming up with more things
View GitHub Profile
@hxii
hxii / hxii-custom-status.php
Last active July 5, 2018 13:22
Custom Order Status support for Yotpo's WooCommerce Plugin
<?
// 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)) {
@hxii
hxii / hxii-woo-date.php
Created May 29, 2018 09:18
Yotpo WooCommerce Date Fix
// 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();