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 wproot_prevent_user_deletion( $deleting_userid ) { | |
$protected_userid = 1; //change 1 to the ID of the user you don't want to be deleted. | |
if ( $deleting_userid == $protected_userid ) { | |
$user_obj = get_user_by('id', $deleting_userid); | |
$name = $user_obj->user_login; | |
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_wc_change_download_expiry_based_on_quantity( $order_id ) { | |
$order = wc_get_order( $order_id ); | |
foreach ($order->get_items() as $item_id => $item ) { | |
$product = $item->get_product(); | |
$product_id = $product->get_id(); |
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_upsells ($cart) { | |
$main_product_ID = 38; //CHANGE TO THE MAIN PRODUCT ID | |
$upsell_product_IDs = array( 39, 40 ); //CHANGE TO YOUR UPSELL PRODUCT ID's | |
$upsell_cart_keys = array(); | |
$has_main_product = false; | |
$has_upsell = false; | |
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; | |
} |
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 '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
<?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 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 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_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' ); |
NewerOlder