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('get_search_form', 'adjust_search_form'); | |
| function adjust_search_form($html){ | |
| $home = get_home_url(); | |
| $shop = wc_get_page_permalink( 'shop' ); | |
| if($home == $shop){ | |
| $shop = $home .'/shop'; | |
| } | |
| $html = str_replace($home, $shop, $html); | |
| return $html; |
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('woocommerce_default_catalog_orderby', 'default_catalog_orderby'); | |
| function default_catalog_orderby( $sort_by ) { | |
| if(count($_GET) < 1 || isset($_GET['s']) && count($_GET) == 1){ | |
| return 'date'; | |
| } | |
| return $sort_by; | |
| } |
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( 'woocommerce_variable_sale_price_html', 'woodev_variable_price_range', 10, 2 ); | |
| add_filter( 'woocommerce_variable_price_html', 'woodev_variable_price_range', 10, 2 ); | |
| function dev_variable_price_range( $dev_price, $product ) { | |
| $prefix = sprintf('%s: ', __('Vanaf', 'translate_domain')); | |
| $dev_reg_min_price = $product->get_variation_regular_price( 'min', true ); | |
| $dev_min_sale_price = $product->get_variation_sale_price( 'min', true ); | |
| $dev_max_price = $product->get_variation_price( 'max', true ); | |
| $dev_min_price = $product->get_variation_price( 'min', true ); |
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
| DELETE relations.*, taxes.*, terms.* | |
| FROM wp_term_relationships AS relations | |
| INNER JOIN wp_term_taxonomy AS taxes | |
| ON relations.term_taxonomy_id=taxes.term_taxonomy_id | |
| INNER JOIN wp_terms AS terms | |
| ON taxes.term_id=terms.term_id | |
| WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type='product'); | |
| DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'product'); | |
| DELETE FROM wp_posts WHERE post_type = 'product'; |
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('admin_init', function(){ | |
| $args = array( | |
| 'date_created' => '<' . ( time() - (3600*24*31*6) ), | |
| 'limit' => 1000 | |
| ); | |
| $orders = wc_get_orders( $args ); | |
| foreach ($orders AS $order) { | |
| wp_delete_post($order->get_id(), true); | |
| } |
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( 'gform_html_message_template_pre_send_email', 'maybe_enable_wc_template_for_gf_notifications'); | |
| function maybe_enable_wc_template_for_gf_notifications($template){ | |
| if(class_exists('woocommerce')) { | |
| ob_start(); | |
| wc_get_template( 'emails/email-header.php', array( 'email_heading' => '{subject}' ) ); | |
| echo '<style>'; | |
| wc_get_template( 'emails/email-styles.php'); | |
| echo '</style>'; | |
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
| <?php | |
| add_action('woocommerce_before_cart_contents', 'woo_notice_free_shipping_minimal_price'); | |
| function woo_notice_free_shipping_minimal_price() { | |
| global $woocommerce; | |
| $bedragGratisVerzenden = 75; | |
| $cart_total = floatval($woocommerce->cart->cart_contents_total); | |
| $extraForFreeShipping = $bedragGratisVerzenden - $cart_total; |
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( 'woocommerce_register_post_type_product', 'wc_modify_product_post_type' ); | |
| function wc_modify_product_post_type( $args ) { | |
| $args['supports'][] = 'revisions'; | |
| return $args; | |
| } |
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('avf_post_css_create_file', '__return_false'); |
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('avf_logo','av_change_logo'); | |
| function av_change_logo($logo) { | |
| if(wp_is_mobile()) { | |
| $logo = "https://url-to-logo.com/path"; | |
| } | |
| return $logo; | |
| } |
OlderNewer