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
| /** | |
| * deactivate gutenberg and woocommerce products block plugins if activated | |
| */ | |
| add_action( 'admin_init', 'atomion_deactivate_gutenberg' ); | |
| function atomion_deactivate_gutenberg() { | |
| if ( is_plugin_active('gutenberg/gutenberg.php') ) { | |
| deactivate_plugins('gutenberg/gutenberg.php'); | |
| } |
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
| /* get rid of all information after item title and quantity */ | |
| add_filter( 'woocommerce_de_additional_item_string', 'gm_remove_each_information' ); | |
| function gm_remove_each_information( $return ) { | |
| $return = ''; | |
| return $return; | |
| } |
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
| public function dhvc_woo_product_page_price_shortcode( $atts, $content = null ) { | |
| global $post, $product; | |
| extract( $this->_shortcode_atts( array( | |
| 'el_class' => '' | |
| ), $atts ) ); | |
| ob_start(); | |
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
| /* "wp" is the earliest possible hook before rendering a page */ | |
| add_action( 'wp', 'disable_author_page' ); | |
| function disable_author_page() { | |
| /* get global $wp_query object */ | |
| global $wp_query; | |
| /* If an author page is requested, answer with 404 | |
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
| // Bestellstatus nach Stripe->Sofortüberweisung direkt auf fertiggestellt | |
| add_action( 'woocommerce_thankyou', 'sofort_force_order_complete', 10, 1 ); | |
| function sofort_force_order_complete( $order_get_id ) { | |
| $order = new WC_Order($order_get_id); | |
| if($order->get_payment_method() == 'stripe_sofort') { |
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
| function atomion_get_posts_pagination( Array $args = array() ) { | |
| global $wp_query; | |
| $paginated = $wp_query->max_num_pages; | |
| if ( $paginated < 2 ) | |
| return ''; | |
| $default_args = array( |
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
| class my_walker_nav_menu extends Walker_Nav_Menu { | |
| static $count=0; | |
| function start_el(&$output, $item, $depth, $args) { | |
| global $wp_query; | |
| $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; |
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 custom fields to quickster */ | |
| add_filter( 'quickster_filter_type', 'add_price', 10 ); | |
| function add_price( $custom ) { | |
| /* thats your custom slug */ | |
| $custom = 'regular_price'; | |
| return $custom; | |
| } | |
| /* remember: the filter ends with your custom slug */ |
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( 'wp_footer', 'gm_output_rbp_meta' ); | |
| function gm_output_rbp_meta( $product_id ) { | |
| $rbp_config = get_post_meta( $product_id, 'rbp_role_config' ); | |
| foreach ( $rbp_config as $group ) { | |
| if ( 'b2b' == key( $group ) ) { | |
| var_dump( $group['b2b']['bulk_price'] ); | |
| } |
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( 'woocommerce_single_product_summary', 'rbp_output_single_product_discount_information', 35 ); | |
| function rbp_output_single_product_discount_information() { | |
| $group = get_user_meta( get_current_user_id(), 'customer_group', true ); | |
| if ( is_user_logged_in() === true && 'stammkunden' === $group ) { | |
| $product = wc_get_product( get_the_id() ); | |
| if ( $product->is_type( 'variable' ) ) { |