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 | |
/** | |
* Default WooCommerce Cart Hooks (just an example, do not copy) | |
* | |
*/ | |
add_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' ); | |
add_action( 'woocommerce_cart_collaterals', 'woocommerce_cart_totals', 10 ); | |
add_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 ); |
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 | |
// Do NOT include the opening php tag | |
add_action( 'woocommerce_before_checkout_form', 'wpdesk_checkout_hello', 5 ); | |
/** | |
* Add "hello" text before WooCommerce checkout form | |
* | |
*/ | |
function wpdesk_checkout_hello() { | |
echo '<h2>Hello there! Happy shopping!</h2>'; |
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 | |
/** | |
* Default WooCommerce Checkout Hooks (just an example, do not copy) | |
* | |
*/ | |
add_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_login_form', 10 ); | |
add_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 ); | |
add_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10 ); | |
add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 ); |
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 | |
// Do NOT include the opening php tag | |
add_action( 'woocommerce_archive_description', 'wpdesk_category_description', 5 ); | |
/** | |
* Add ACF Category Description to WooCommerce | |
* | |
*/ | |
function wpdesk_category_description() { | |
$queried_object = get_queried_object(); |
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( 'template_include', 'wpdesk_search_template' ); | |
// Docs Live Search Template | |
function wpdesk_search_template( $template ) { | |
global $wp_query; | |
$post_type = get_query_var('post_type'); | |
if( $wp_query->is_search && $post_type == 'docs' ) { |
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 | |
// Do NOT include the opening php tag | |
// Make all products to be sold individually | |
add_filter( 'woocommerce_is_sold_individually', '__return_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
<?php | |
// Do NOT include the opening php tag shown above. Copy the code shown below. | |
add_filter( 'woocommerce_email_order_meta_keys', 'wpdesk_vat_number_display_email' ); | |
/** | |
* VAT Number in emails | |
*/ | |
function wpdesk_vat_number_display_email( $keys ) { | |
$keys['VAT Number'] = '_vat_number'; | |
return $keys; |
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 | |
// Do NOT include the opening php tag shown above. Copy the code shown below. | |
add_action( 'woocommerce_admin_order_data_after_billing_address', 'wpdesk_vat_number_display_admin_order_meta', 10, 1 ); | |
/** | |
* Display VAT Number in order edit screen | |
*/ | |
function wpdesk_vat_number_display_admin_order_meta( $order ) { | |
echo '<p><strong>' . __( 'VAT Number', 'woocommerce' ) . ':</strong> ' . get_post_meta( $order->id, '_vat_number', true ) . '</p>'; | |
} |
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 | |
// Do NOT include the opening php tag shown above. Copy the code shown below. | |
add_action( 'woocommerce_after_order_notes', 'wpdesk_vat_field' ); | |
/** | |
* VAT Number in WooCommerce Checkout | |
*/ | |
function wpdesk_vat_field( $checkout ) { | |
echo '<div id="wpdesk_vat_field"><h2>' . __('VAT Number') . '</h2>'; | |
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 | |
/** | |
* Shipping Methods Display | |
* | |
* In 2.1 we show methods per package. This allows for multiple methods per order if so desired. | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-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 |