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 to restrict users from placing multiple orders per hour | |
function restrict_orders_per_hour_product_notice() { | |
// Get the current user's ID. | |
$user_id = get_current_user_id(); | |
// Retrieve all orders for the current user. | |
$orders = wc_get_orders( array( | |
'numberposts' => -1, | |
'orderby' => 'date', |
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
/** | |
* Get Post object by post_meta query | |
* | |
* @use $post = get_post_by_meta( array( 'meta_key' => meta_name, 'meta_value' => value, 'post_type' => post_type, 'post_per_page' => post_per_page ) ) | |
* @since 1.0.5 | |
* @return Object WP post object | |
*/ | |
function get_post_by_meta( $args = array() ) { | |
$args = (object) wp_parse_args( $args ); | |
$args = array( |
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
jQuery( document ).on( 'click', '.elementor-widget-theme-site-logo, .custom-logo', function(e) { | |
e.preventDefault(); | |
window.location.href = "https://new URL"; | |
}); |
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
/** | |
* Exclude products from a particular category on the shop page | |
*/ | |
function hide_products_in_unc( $q ) { | |
$tax_query = (array) $q->get( 'tax_query' ); | |
$tax_query[] = array( | |
'taxonomy' => 'product_cat', | |
'field' => 'slug', | |
'terms' => array( 'uncategorized' ), | |
'operator' => 'NOT IN' |
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
jQuery(document).ready(function() { | |
jQuery("[id^=quform_10_218_]").change(function(event) { | |
jQuery("[id^=quform_10_1]") | |
.find("option:selected") | |
.removeAttr("selected"); | |
jQuery("[id^=quform_10_1]").val(""); | |
jQuery("[id^=quform_10_1]").change(); | |
jQuery("[id^=quform-form]").closest('form').trigger("reset"); | |
}); | |
}); |
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_product_tabs', 'vagelis_dev_merge_tabs', 99 ); | |
function vagelis_dev_merge_tabs( $tabs ) { | |
$tabs['description']['callback'] = function() { | |
global $product; | |
the_content(); | |
do_action( 'woocommerce_product_additional_information', $product ); | |
}; | |
unset( $tabs['additional_information'] ); | |
return $tabs; |
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 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?> | |
<?php global $post;?> | |
<?php | |
$columns = (isset($columns)) ? $columns : ''; | |
$aff_link = (isset($aff_link)) ? $aff_link : ''; | |
if(!isset($disable_btn)){ | |
$disable_btn = (rehub_option('rehub_enable_btn_recash') == 1) ? 0 : 1; | |
} | |
$gridtype = (isset($gridtype)) ? $gridtype : ''; | |
if(rehub_option('disable_btn_offer_loop')){ |
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 post_change_expired_function_new () { | |
if (is_admin()): | |
return; | |
endif; | |
if (is_single()): | |
$offer_coupon_date = get_post_meta( $post->ID, 'rehub_offer_coupon_date', true ); | |
$timestamp1 = strtotime($offer_coupon_date) + 86399; | |
$seconds = $timestamp1 - (int)current_time('timestamp',0); | |
$days = floor($seconds / 86400); | |
$seconds %= 86400; |
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
//remove the text {PHP} | |
add_filter( 'woocommerce_product_add_to_cart_text', 'change_text_woo' ); | |
function change_text_woo() { | |
return; | |
} | |
//add the icon {CSS} | |
a.button.product_type_simple.add_to_cart_button.ajax_add_to_cart:after { | |
content: "\f111"; | |
font-family: dashicons; |
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_cart_calculate_fees','custom_tax_surcharge_for_retailers', 10, 1 ); | |
function custom_tax_surcharge_for_retailers( $cart ) { | |
if ( is_admin() && ! defined('DOING_AJAX') ) return; | |
global $woocommerce; | |
if ( isset( $_POST['post_data'] ) ) { | |
parse_str( $_POST['post_data'], $post_data ); | |
} else { | |
$post_data = $_POST; | |
} |
NewerOlder