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
add_action( | |
'woocommerce_init', | |
function() { | |
woocommerce_register_additional_checkout_field( | |
array( | |
'id' => 'namespace/delivery-date-id', | |
'label' => 'Delivery Date', | |
'optionalLabel' => 'Delivery Date (optional)', | |
'location' => 'address', | |
'required' => true, |
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
<script> | |
/** | |
* Clears the cart in Shopify and logs the result or errors. | |
*/ | |
function clearCart() { | |
fetch('/cart/clear.js', { | |
method: 'POST', | |
headers: { | |
'Content-Type': 'application/json', | |
'Accept': 'application/json' |
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> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>BMI Calculator</title> | |
<style> | |
body { | |
font-family: Arial, sans-serif; | |
margin: 20px; |
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 | |
function kl_tax_toggle_shortcode() { | |
$kl_show_tax = isset($_COOKIE['kl_show_tax']) ? $_COOKIE['kl_show_tax'] : 'yes'; | |
ob_start(); | |
?> | |
<div class="kl-tax-toggle-wrapper"> | |
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( 'get_post_metadata', 'WDFI_get_post_metadata', 50, 10); | |
function WDFI_get_post_metadata($null, $object_id, $meta_key, $single ){ | |
if ( ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) ) { | |
return $null; | |
} | |
if ( ! empty( $meta_key ) && '_thumbnail_id' !== $meta_key ) { | |
return $null; | |
} | |
$post_type = get_post_type( $object_id ); |
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 | |
/** | |
* WooCommerce Extra Feature | |
* -------------------------- | |
* | |
* Add custom fee to cart automatically | |
* | |
*/ | |
function woo_add_cart_fee() { | |