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 | |
/* | |
URL: https://wproot.dev/blog/get-woocommerce-current-product-category-single-product-page/ | |
*/ | |
if ( has_term( 'tshirts', 'product_cat' ) ) //product category is tshirts | |
{ | |
$flatrate = '10.00'; | |
} | |
elseif ( has_term( 'hoodies', 'product_cat' ) ) //product category is hoodies |
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 | |
/* | |
URL: https://wproot.dev/blog/woocommerce-display-all-products-eligible-for-coupons/ | |
*/ | |
$args = array( | |
'posts_per_page' => -1, //show all posts | |
'post_type' => 'shop_coupon', //custom post type | |
'post_status' => 'publish', //published coupons only | |
); |
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 | |
/* | |
Template Name: My Awesome Template | |
Uses Slider: No | |
*/ |
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 | |
function my_custom_subheading () { | |
echo '<p><span style="font-size: small; font-weight: bold; background: orange; color: #fff; text-align: center;">Stock is limited. Order now before they\'re all gone!</span></p>'; | |
} | |
add_action( 'thp_mult_radio_template_before_radiobox', 'my_custom_subheading' ); |
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 | |
function my_custom_heading () { | |
return 'The novel has been made into a movie! Get the movie too?'; | |
} | |
add_filter( 'thp_mult_radio_template_heading', 'my_custom_heading' ); |
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 | |
function my_custom_heading ($heading) { | |
return 'The novel has been made into a movie! ' . $heading; | |
} | |
add_filter( 'thp_mult_radio_template_heading', 'my_custom_heading' ); |
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 | |
function thp_remove_upsell ($cart) { | |
$main_product_ID = 38; //CHANGE TO THE MAIN PRODUCT ID | |
$upsell_product_ID = 39; //CHANGE TO YOUR UPSELL PRODUCT ID | |
$has_main_product = false; | |
$has_upsell = false; | |
foreach( $cart->get_cart() as $cart_item_key => $cart_item ) { |
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 | |
function thp_wup_custom_change_strings( $translated_text, $text, $domain ) { | |
if ($domain == 'very-simple-woocommerce-upsell-popup') { | |
switch ($translated_text) { | |
case 'The item has been added to cart. Thank you!' : | |
$translated_text = __( 'Der Artikel wurde in den Warenkorb gelegt. Vielen Dank!', 'very-simple-woocommerce-upsell-popup' ); | |
break; | |
case 'Would you also be interested in this item?': |
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
.thp-popup-container .thp-flickity-container .thp-carousel .flickity-slider>div.thp-carousel-cell { | |
width: 24.5% !important; | |
} | |
.thp-popup-container .thp-flickity-container .thp-carousel button.flickity-prev-next-button { | |
opacity: 1 !important; | |
} |
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 | |
function thp_wup_custom_change_strings( $translated_text, $text, $domain ) { | |
if ($domain == 'very-simple-woocommerce-upsell-popup') { | |
switch ($translated_text) { | |
case 'Added to Cart!' : | |
$translated_text = __( 'Tillagd i kundvagnen!', 'very-simple-woocommerce-upsell-popup' ); | |
break; | |
} |
OlderNewer