// http://stackoverflow.com/questions/26581467/creating-woocommerce-order-with-line-item-programatically
$address = array(
'first_name' => 'Fresher',
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
DELIMITER // | |
CREATE FUNCTION UUID_TO_BIN(uuid CHAR(36)) | |
RETURNS BINARY(16) DETERMINISTIC | |
RETURN UNHEX(CONCAT(REPLACE(uuid, '-', ''))); // | |
DELIMITER ; |
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
DELIMITER // | |
CREATE FUNCTION BIN_TO_UUID(bin BINARY(16)) | |
RETURNS CHAR(36) DETERMINISTIC | |
BEGIN | |
DECLARE hex CHAR(32); | |
SET hex = HEX(bin); | |
RETURN LOWER(CONCAT(LEFT(hex, 8), '-', MID(hex, 9, 4), '-', MID(hex, 13, 4), '-', MID(hex, 17, 4), '-', RIGHT(hex, 12))); | |
END; // |
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
<template> | |
<v-row class="fill-height"> | |
<v-col> | |
<v-sheet height="64"> | |
<v-toolbar flat color="white"> | |
<v-btn outlined class="mr-4" color="grey darken-2" @click="setToday">Today</v-btn> | |
<v-btn fab text small color="grey darken-2" @click="prev"> | |
<v-icon small>mdi-chevron-left</v-icon> | |
</v-btn> | |
<v-btn fab text small color="grey darken-2" @click="next"> |
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
<?php | |
/** | |
* Check if WooCommerce is active | |
**/ | |
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { | |
// remove product thumbnail and title from the shop loop | |
remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 ); | |
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); | |
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
<?php | |
/* | |
Sometimes you need to do some kind of action to a custom post type after its saved. | |
In the case of this function my scenario is: | |
1. I have a custom post type registered called: clients | |
2. I want the url of their details page to be: /client-number-999/ (where 999 is the post_id - or client id) | |
Created by [email protected] on 16th of August 2017 |
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
<?php | |
/* | |
This script will allow you to send a custom email from anywhere within wordpress | |
but using the woocommerce template so that your emails look the same. | |
Created by [email protected] on 27th of July 2017 | |
Put the script below into a function or anywhere you want to send a custom email | |
*/ |
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
<?php | |
/* | |
Created by: [email protected] 16/03/2014 | |
Name of script: Create WordPress Admin User | |
Description: This script will create an admin user in wordpress | |
Usage: Create a new file in the root of the hosting account and drop this code into it then execute the script through the browser. |
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
<!DOCTYPE html> | |
<head> | |
<script type='text/javascript'> | |
window.onload = function () { | |
var video = document.getElementById('videoId'); | |
var canvas = document.getElementById('canvasId'); | |
var img = document.getElementById('imgId'); | |
video.addEventListener('play', function () { | |
canvas.style.display = 'none'; |
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
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |