Skip to content

Instantly share code, notes, and snippets.

View vishalck's full-sized avatar

Vishal Kothari vishalck

View GitHub Profile
@esedic
esedic / customer_data.sql
Created April 3, 2017 14:28
Get customer data from Woocommerce orders
select
p.ID as order_id,
p.post_date,
max( CASE WHEN pm.meta_key = '_billing_email' and p.ID = pm.post_id THEN pm.meta_value END ) as billing_email,
max( CASE WHEN pm.meta_key = '_billing_first_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_first_name,
max( CASE WHEN pm.meta_key = '_billing_last_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_last_name,
max( CASE WHEN pm.meta_key = '_billing_address_1' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_1,
max( CASE WHEN pm.meta_key = '_billing_address_2' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_2,
max( CASE WHEN pm.meta_key = '_billing_city' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_city,
max( CASE WHEN pm.meta_key = '_billing_state' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_state,
@NateWr
NateWr / adwords-tracking-for-rtb.php
Last active June 3, 2019 07:42
Output Google Adwords tracking code when a booking request is made.
<?php
/**
* Plugin Name: Google Adwords Tracking for Restaurant Reservations
* Plugin URI: http://themeofthecrop.com
* Description: Insert a Google Adwords Campaign conversion tracking snippet when a new booking request has been made.
* Version: 0.0.1
* Author: Theme of the Crop
* Author URI: http://themeofthecrop.com
* License: GNU General Public License v2.0 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html