Skip to content

Instantly share code, notes, and snippets.

View Super-Chama's full-sized avatar
🍊
Back to office

Chamara Abesinghe Super-Chama

🍊
Back to office
View GitHub Profile
@Super-Chama
Super-Chama / ticket_count_shortcode.php
Created September 20, 2018 18:29
WP-Eventer Plugin shortcode to get remaining tickets.
//Product Sales Shortcode
function ticket_count_shortcode( $atts ) {
$atts = shortcode_atts( array( 'id' => null, 'count' => 0), $atts, 'bartag' );
if( intval( $atts['id'] ) > 0 && function_exists( 'wc_get_product' ) ){
$_product = wc_get_product( $atts['id'] );
$tickets_left = $atts['count']-($_product->get_total_sales());
}
return $tickets_left;
}
@Super-Chama
Super-Chama / -
Created December 27, 2017 17:09 — forked from anonymous/-
System: Host: batputer Kernel: 4.10.0-38-generic x86_64 (64 bit gcc: 5.4.0)
Desktop: Cinnamon 3.6.6 (Gtk 3.18.9-1ubuntu3.3) dm: lightdm Distro: Linux Mint 18.3 Sylvia
Machine: System: LENOVO (portable) product: 80XL v: Lenovo ideapad 320-15IKB
Mobo: LENOVO model: LNVNB161216 v: NO DPK Bios: LENOVO v: 4WCN37WW date: 12/04/2017
Chassis: type: 10 v: Lenovo ideapad 320-15IKB
CPU: Dual core Intel Core i3-7100U (-HT-MCP-) cache: 3072 KB
flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 9600
clock speeds: min/max: 400/2400 MHz 1: 699 MHz 2: 699 MHz 3: 699 MHz 4: 699 MHz
Graphics: Card: Intel Device 5916 bus-ID: 00:02.0 chip-ID: 8086:5916
Display Server: X.Org 1.18.4 drivers: intel (unloaded: fbdev,vesa)