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
/** | |
* Hides the cost for free checkout add-ons | |
* | |
* @param string $html | |
* @param object $fee | |
* @return string | |
*/ | |
function wc_hide_fee_cost( $html, $fee ) { | |
$hide_for = array( | |
'testo' |
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 nyp_move_minimum_price(){ | |
$wc_name_your_price_display = WC_Name_Your_Price()->display; | |
remove_action( 'woocommerce_nyp_after_price_input', array($wc_name_your_price_display,'display_minimum_price'), 10 ); | |
add_action( 'woocommerce_before_single_product', array( $wc_name_your_price_display, 'display_minimum_price' ) ); | |
} | |
add_action( 'woocommerce_before_single_product' , 'nyp_move_minimum_price', 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
/** | |
* Adds a tab into the single product page for EXIF Data | |
* | |
* @param array $tabs | |
* @return array | |
*/ | |
function wc_photography_exif_tab( $tabs ) { | |
global $product; | |
if ( $product->is_type( 'photography' ) ) { |
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
/** | |
* Adds a tab into the single product page for EXIF Data | |
* | |
* @param array $tabs | |
* @return array | |
*/ | |
function wc_photography_exif_tab( $tabs ) { | |
global $product; | |
if ( $product->is_type( 'photography' ) ) { |
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
/** | |
* Adds a tab into the single product page for EXIF Data | |
* | |
* @param array $tabs | |
* @return array | |
*/ | |
function wc_photography_exif_tab( $tabs ) { | |
$exif = array( | |
'title' => __( 'EXIF Data', 'domain' ), | |
'callback' => 'wc_photography_get_exif_data', |
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
/** | |
* Set a custom add to cart URL to redirect to | |
* @return string | |
*/ | |
function custom_add_to_cart_redirect() { | |
return 'http://www.yourdomain.com/your-page/'; | |
} | |
add_filter( 'woocommerce_add_to_cart_redirect', 'custom_add_to_cart_redirect' ); |
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
/** | |
* Prints the Google Analytics tracking code in the Thank you page. | |
* @return void | |
*/ | |
function wc_ga_conversion_tracking() { | |
if ( is_order_received_page() ) { | |
?> | |
<!-- PUT YOUR GA CODE HERE --> | |
<?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
add_action( 'template_redirect', 'wc_custom_redirect_after_purchase' ); | |
function wc_custom_redirect_after_purchase() { | |
global $wp; | |
if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) { | |
wp_redirect( 'http://www.yoururl.com/your-page/' ); | |
exit; | |
} | |
} |
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( 'wc_custom_thankyou_failed', 'wc_custom_thankyou_failed', 10 ); | |
function wc_custom_thankyou_failed( $order ) { | |
wc_get_template( 'custom-thankyou/failed.php', array( 'order' => $order ) ); | |
} | |
add_action( 'wc_custom_thankyou_successful', 'wc_custom_thankyou_header', 10 ); | |
function wc_custom_thankyou_header( $order ) { | |
wc_get_template( 'custom-thankyou/header.php', array( 'order' => $order ) ); | |
} |
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_filter( 'the_content', 'wc_custom_thankyou' ); | |
function wc_custom_thankyou( $content ) { | |
// Check if is the correct page | |
if ( ! is_page( {PAGE_ID} ) ) { | |
return $content; | |
} | |
// check if the order ID exists | |
if ( ! isset( $_GET['order'] ) ) { | |
return $content; |