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
function woo_ninja_remove_price_range( $price, $product ) { | |
// Main Price | |
$prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) ); | |
$price = $prices[0] !== $prices[1] ? sprintf( __( '%1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); | |
// Sale Price | |
$prices = array( $product->get_variation_regular_price( 'min', true ), $product->get_variation_regular_price( 'max', true ) ); | |
sort( $prices ); | |
$saleprice = $prices[0] !== $prices[1] ? sprintf( __( '%1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); |
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
add_filter( 'wp_footer' , 'rc_localize_datepicker' ); | |
/** | |
* Localize datepicker fields | |
* | |
* @access public | |
* @since 1.0 | |
* @return void | |
*/ | |
function rc_localize_datepicker() { |
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
function woo_related_products_limit() { | |
global $product; | |
$args['posts_per_page'] = 6; | |
return $args; | |
} | |
add_filter( 'woocommerce_output_related_products_args', 'jk_related_products_args' ); | |
function jk_related_products_args( $args ) { | |
$args['posts_per_page'] = 6; // 4 related products | |
$args['columns'] = 3; // arranged in 2 columns |
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
add_action( 'woocommerce_thankyou', 'my_custom_code' ); | |
function my_custom_code() { | |
?> | |
<!-- My Custom Code --> | |
<script src ="https://research.pricerunner.com/cgi-bin/quest/cssi.js?quest=102&client=CID"></script><a href="#" onclick="launchCSS()">Skriv in den text ni vill visa för länken här</a> | |
<?php | |
} |
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
function wc_ninja_remove_password_strength() { | |
if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) { | |
wp_dequeue_script( 'wc-password-strength-meter' ); | |
} | |
} | |
add_action( 'wp_print_scripts', 'wc_ninja_remove_password_strength', 100 ); |
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
.cart_totals tr.shipping td, | |
#order_review tr.shipping td { | |
visibility: hidden; | |
float: left; | |
} | |
.cart_totals tr.shipping td span.amount, | |
#order_review tr.shipping td span.amount { | |
visibility: visible; | |
float: left; |
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
add_filter( 'woocommerce_admin_stock_html', 'tmt_show_variation_stock_level', 10, 2 ); | |
function tmt_show_variation_stock_level( $stock_html, $the_product ) { | |
if( sizeof( $the_product->get_children() ) ) { | |
$stock_html .= ' (' . $the_product->get_total_stock() . ')'; | |
} |
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
add_filter('woocommerce_login_redirect', 'wc_login_redirect', 10, 2 ); | |
function wc_login_redirect( $redirect_to, $user ) { | |
$role = $user->roles[0]; | |
$myaccount = get_permalink( wc_get_page_id( 'myaccount' ) ); | |
if( $role == 'customer' ) { | |
$redirect_to = home_url(); | |
} | |
return $redirect_to; | |
} |
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
function my_woocommerce_continue_shopping_redirect( $return_to ) { | |
return get_permalink( wc_get_page_id( 'shop' ) ); | |
} | |
add_filter( 'woocommerce_continue_shopping_redirect', 'my_woocommerce_continue_shopping_redirect', 20 ); |
OlderNewer