Skip to content

Instantly share code, notes, and snippets.

@goranefbl
goranefbl / updates.php
Created January 2, 2018 13:34 — forked from digitalchild/updates.php
WooCommerce 3.0 Compatibility
<?php
# WooCommerce 2.6 -> 3.0 "Compatibility" Variables
$order_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->id : $order->get_id();
$order_date = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->order_date : $order->get_date_created();
$billing_first_name = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->billing_first_name : $order->get_billing_first_name();
$billing_last_name = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->billing_last_name : $order->get_billing_last_name();
$.ajax({
type: "POST",
url: 'https://blissco.sandbox.onample.com/api/v1/users/login',
data: 'username=user&password=pass',
success: function(data)
{
let headers = new Headers();
headers.set('Authorization', 'Basic ' + btoa("key:secret"));
headers.set('Content-Type','application/json');
@goranefbl
goranefbl / 0_README.md
Created December 7, 2019 12:16 — forked from drazisil/0_README.md
Example code using react-filepond and multer to upload files to a server
@goranefbl
goranefbl / gist:afc081571482f1c44ff72d4c49cba508
Created March 30, 2021 19:15 — forked from mikejolley/gist:1604009
WooCommerce - Add a special field to the checkout, order emails and user/order meta
/**
* Add the field to the checkout
**/
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>';
/**