cart->get_checkout_url(); ?> '; } add_filter( 'woocommerce_output_related_products_args', 'abc_output_related_products' ); function abc_output_related_products() { return array( 'posts_per_page' => 3, 'columns' => 3, 'orderby' => 'rand' ); } remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 ); add_action( 'woocommerce_after_single_product_summary', 'abc_woocommerce_output_upsells', 15 ); function abc_woocommerce_output_upsells() { woocommerce_upsell_display( 3,3 ); // Display 3 products in rows of 3 } add_filter( 'woocommerce_product_single_add_to_cart_text', 'abc_custom_cart_button_text' ); add_filter( 'woocommerce_product_add_to_cart_text', 'abc_custom_cart_button_text' ); function abc_custom_cart_button_text() { return '+'; } remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 ); remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 ); add_action( 'woocommerce_shop_loop_item_title', 'abc_woocommerce_template_loop_product_title', 10 ); function abc_woocommerce_template_loop_product_title() { echo '

' . get_the_title() . '

'; $product_cats = wp_get_post_terms( get_the_ID(), 'product_cat' ); if ( $product_cats && ! is_wp_error ( $product_cats ) ){ $single_cat = array_shift( $product_cats ); ?> name; ?> '; } function abc_search_pagination( $query ) { $max_page = $query->max_num_pages; $paged = ( get_query_var('paged') ) ? get_query_var( 'paged' ) : 1; $type = ( isset( $query->query['post_type'] ) ) ? $query->query['post_type'] : 'post'; $prev_search_post_type = ( 2 == $paged ) ? '' : '&search_post_type=' . esc_attr( $type ); $next_post_link = str_replace( '&search_post_type=' . esc_attr( $type ), '', next_posts( $max_page, false ) ); $prev_post_link = str_replace( '&search_post_type=' . esc_attr( $type ), '', previous_posts( false ) ); $prev_label = ( 2 == $paged ) ? __( 'All results →', 'abacus' ) : sprintf( __( 'Next %s results →', 'abacus' ), ucfirst( $type . 's' ) ); // Don't print empty markup if there's only one page. if ( $max_page < 2 ) return; $next_posts_link = ( intval($paged) + 1 <= $max_page ) ? '' . sprintf( __( '← Previous %s results', 'abacus' ), ucfirst( $type . 's' ) ) . '' : ' '; $prev_posts_link = ( $paged > 1 ) ? '' . $prev_label . '' : ' '; ?> is_search && $query->is_main_query() ) $query->set( 'post_type', array( 'post' ) ); return $query; }