This file contains 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
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php). | |
// Used in conjunction with https://gist.github.com/DanielSantoro/1d0dc206e242239624eb71b2636ab148 | |
// Compatible with WooCommerce 3.0+. Thanks to Alex for assisting with an update! | |
function woocommerce_header_add_to_cart_fragment( $fragments ) { | |
global $woocommerce; | |
ob_start(); | |
?> |
This file contains 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
// Use in conjunction with https://gist.github.com/DanielSantoro/948c5000850c4695f30db8542f8bc966 | |
<a class="cart-customlocation" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf ( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a> |
This file contains 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 | |
// For formatting, this is just a segment of the file found in | |
// `woocommerce-shipment-tracking/includes/class-wc-shipment-tracking.php` Line 68 - 163 | |
/** | |
* Get shiping providers. | |
* | |
* @return array | |
*/ | |
public function get_providers() { |
This file contains 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 // Do not include this line - only for formatting purposes | |
add_filter( 'woocommerce_ajax_variation_threshold', function() { return 50; } ); |
This file contains 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 // Do not copy this line - start at Line 3 | |
// Auto-Complete Virtual Orders | |
add_filter( 'woocommerce_payment_complete_order_status', 'bryce_autocomplete_virtual_orders', 10, 2 ); | |
function bryce_autocomplete_virtual_orders( $order_status, $order_id ) { | |
$order = wc_get_order( $order_id ); | |
if ('processing' == $order_status && ('on-hold' == $order->status || 'pending' == $order->status || 'failed' == $order->status)) { | |
$virtual_order = ''; |
This file contains 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 // Do not copy this line into your code unless you're making a custom plugin for this purpose specifically. | |
public function init() { | |
$this->date_format = _x( 'd-m-Y', 'date format for php', 'woocommerce-order-delivery' ); | |
$this->date_format_js = _x( 'dd-mm-yyyy', 'date format for js', 'woocommerce-order-delivery' ); |
This file contains 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 | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly | |
} | |
/** | |
* Contains Validation functions | |
* | |
* @class WC_Validation |
This file contains 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 Tracking Code to the Thank You Page - http://danielsantoro.com/add-facebook-tracking-pixel-woocommerce-checkout/ | |
*/ | |
function ds_checkout_analytics( $order_id ) { | |
$order = new WC_Order( $order_id ); | |
$currency = $order->get_order_currency(); | |
$total = $order->get_total(); | |
$date = $order->order_date; | |
?> |
This file contains 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 | |
/** | |
* Checkout shipping information form | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-shipping.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
This file contains 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
<iframe src="https://www.youtube.com/embed/BEMlvjJ9uxo?rel=0" width="640" height="360" frameborder="0" allowfullscreen="allowfullscreen"></iframe> | |
WHAT UP?! | |
Are you ready for the best idea ever? Do you have money? Do you want even more money? Well guess what? We've got a great idea for you? | |
<strong>FIGHT MILK!</strong> | |
The first alcoholic dairy-based protein drink for bodyguards, by bodyguards. | |
<blockquote>I drink it every morning so I can fight, like a crow!</blockquote> |