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
function bkap_woocommerce_cart_item_subtotal( $product_subtotal, $cart_item, $cart_item_key ) { | |
if ( isset( $cart_item['bkap_booking'] ) ) { | |
$booking = $cart_item['bkap_booking'][0]; | |
if ( isset( $booking[ 'hidden_date_checkout' ] ) ) { | |
$checkin_date_str = strtotime( $booking[ 'hidden_date' ] ); | |
$checkout_date_str = strtotime( $booking[ 'hidden_date_checkout' ] ); | |
$checkin_date = date( 'Y-m-d', $checkin_date_str ); | |
$checkout_date = date( 'Y-m-d', $checkout_date_str ); |
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
//this is a function that fires when the webapp receives a GET request | |
function doGet(e) { | |
return HtmlService.createHtmlOutput("request received"); | |
} | |
//this is a function that fires when the webapp receives a POST request | |
function doPost(e) { | |
var myData = JSON.parse([e.postData.contents]); | |
var order_number = myData.number; | |
var order_created = myData.date_created; |
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
{ | |
"id":1194, | |
"parent_id":0, | |
"number":"1194", | |
"order_key":"wc_order_YzXqv7u79WjZS", | |
"created_via":"checkout", | |
"version":"3.6.4", | |
"status":"on-hold", | |
"currency":"USD", | |
"date_created":"2019-07-20T02:08:30", |
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
//this is a function that fires when the webapp receives a GET request | |
function doGet(e) { | |
return HtmlService.createHtmlOutput("request received"); | |
} | |
//this is a function that fires when the webapp receives a POST request | |
function doPost(e) { | |
var myData = JSON.parse([e.postData.contents]); | |
var order_number = myData.number; | |
var order_created = myData.date_created; |
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 | |
add_filter( 'orddd_time_slider_minute_step', 'ts_orddd_overwrite_minute_increment', 10, 1 ); | |
function ts_orddd_overwrite_minute_increment( $step_minute ) { | |
$step_minute = 15; | |
return $step_minute; | |
} |
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 | |
add_filter( 'orddd_global_specific_delivery_dates', 'ts_add_global_specific_delivery_charges_by_variations', 10, 4 ); | |
function ts_add_global_specific_delivery_charges_by_variations( $specific_fees, $specific_date, $specific_date_charges, $specific_charges_label ) { | |
global $woocommerce; | |
$found = false; | |
// determine if selected variation is in cart or not |
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 | |
echo strtotime( '21-02-2019 10:0' ); // 1550743200 | |
echo '<br>' . strtotime( '21-02-2019 10:00' ); // 1550743200 | |
echo '<br>' . strtotime( '21-02-2019 100' ); // blank, thereby results in a date of 1-1-1970 when used in date() | |
echo '<br>' . strtotime( '21-02-2019 1000' ); // 1550743200 |
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 | |
add_action( 'woocommerce_after_checkout_billing_form', 'display_extra_fields_after_billing_address' , 10, 1 ); | |
function display_extra_fields_after_billing_address () { | |
_e( "Delivery Date: ", "add_extra_fields"); | |
?> | |
<br> | |
<input type="text" name="add_delivery_date" class="add_delivery_date" placeholder="Delivery Date"> | |
<?php | |
} |
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 | |
/* | |
Plugin Name: Extra API Endpoints for Easy Digital Downloads | |
Plugin URI: https://www.tychesoftwares.com | |
Description: This plugin allows to fetch some additional statistics for your Easy Digital Downloads store. | |
Author: Tyche Softwares | |
Version: 1.0 | |
Author URI: http://www.tychesoftwares.com/about | |
Contributor: Tyche Softwares, http://www.tychesoftwares.com/ | |
*/ |
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 | |
add_action( 'woocommerce_thankyou', 'show_custom_text_by_variation_id', 1 ); | |
function show_custom_text_by_variation_id( $order_id ) { | |
$order = wc_get_order( $order_id ); | |
foreach( $order->get_items() as $item ) { | |
// Add whatever variation id you want below here. My attributes are Cheddar, Mozarella & Swiss | |
if ( isset( $item[ 'variation_id' ] ) && $item[ 'variation_id' ] == 446 ) { | |
echo 'Thank you for choosing Cheddar cheese. Enjoy your Sandwich!<br/>'; | |
} |
NewerOlder