/ '; return $defaults; } add_filter( 'woocommerce_breadcrumb_defaults', 'capri_change_breadcrumb_delimiter' ); /** * Hook before shop item title. * * @since 1.0.0 * @access public */ function capri_before_single_product_summary() { ?>
term_id ) ) { $dropdown_categories[ $category->term_id ] = $category->name; } } } $text_to_display = esc_html__( 'Post categories +', 'capri-lite' ); } if ( ! empty( $dropdown_categories ) ) { ?>
'; } add_action( 'woocommerce_checkout_order_review', 'capri_coupon_after_order_table' ); // remove default sorting dropdown remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); // remove add to cart button remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); /** * Product Single - Summary Box. * * @see capri_woo_before_product_title() - priority 5 - added * @see woocommerce_template_single_meta() - priority 10 - added * @see woocommerce_template_single_excerpt() * @see woocommerce_template_single_rating() - priority 40 - added * @see woocommerce_template_single_sharing() * @see capri_woo_after_product_info() - priority 100 - added */ remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 ); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 ); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 ); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 50 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 40 ); add_action( 'woocommerce_product_meta_end', 'capri_register_sharing_icons' ); /** * This function wrap product title in a div with class woo-product-title-wrapper * and opens container for product info * * @since 1.0.0 * @access public */ function capri_woo_before_product_title() { ?>

Linked Products -> Up-sells ) add_filter( 'woocommerce_upsell_display_args', 'capri_woo_related_products_number' ); // Filter for related products ( displayed by default ) add_filter( 'woocommerce_output_related_products_args', 'capri_woo_related_products_number' ); /** * Change number of products for woocommerce * * @since 1.0.0 * @access public */ function capri_new_woo_related_products_number() { return apply_filters( 'capri_single_product_related_items', 3 ); // 3 related products } add_filter( 'woocommerce_upsells_total', 'capri_new_woo_related_products_number' ); /** * Add placeholders in review form. * * @param array $comment_form Form options. * * @since 1.0.0 * @access public * @return mixed */ function capri_woo_comment_form_args( $comment_form ) { $commenter = wp_get_current_commenter(); $comment_form['fields'] = array( 'author' => '

' . ' ' . '

', 'email' => '

' . '

', ); if ( get_option( 'woocommerce_enable_review_rating' ) === 'yes' ) { $comment_form['comment_field'] = '

'; } $comment_form['comment_field'] .= '

'; $comment_form['title_reply'] = have_comments() ? sprintf( /* translators: %s is post title */ apply_filters( 'capri_woo_title_reply', esc_html__( 'Add a review for: \'%s\'', 'capri-lite' ) ), get_the_title() ) : sprintf( /* translators: %s is post title */ esc_html__( 'Be the first to review “%s”', 'capri-lite' ), get_the_title() ); return $comment_form; } add_filter( 'woocommerce_product_review_comment_form_args', 'capri_woo_comment_form_args' ); /** * Cart. * * @see woocommerce_cart_totals() - priority 10 * @see woocommerce_button_proceed_to_checkout() - priority 20 * @see woocommerce_cross_sell_display() - priority 30 */ remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' ); /** * Cross sells filter * * @since 1.0.0 * @access public */ function capri_woo_cross_sells() { ?>
%s %s%s', esc_html( $title ), esc_html__( 'has been added to your cart.', 'capri-lite' ), $shop_url, esc_html__( 'Continue Shopping', 'capri-lite' ) ); } else { $message = sprintf( '%s %s%s%s', esc_html( $title ), esc_html__( 'has been added to your cart.', 'capri-lite' ), $shop_url, esc_html__( 'Continue Shopping', 'capri-lite' ), $cart_url, esc_html__( 'View Cart', 'capri-lite' ) ); } } else { if ( $cart_redirect === 'yes' ) { $message = sprintf( '%s %s%s', esc_html( $title ), esc_html__( 'has been added to your cart.', 'capri-lite' ), $shop_url, esc_html__( 'Continue Shopping', 'capri-lite' ) ); } else { $message = sprintf( '%s %s%s%s', esc_html( $title ), esc_html__( 'has been added to your cart.', 'capri-lite' ), $shop_url, esc_html__( 'Continue Shopping', 'capri-lite' ), $cart_url, esc_html__( 'View Cart', 'capri-lite' ) ); } } return $message; } if ( function_exists( 'wc_deprecated_function' ) ) { add_filter( 'wc_add_to_cart_message_html', 'capri_woocommerce_add_to_cart_message' ); } else { add_filter( 'wc_add_to_cart_message', 'capri_woocommerce_add_to_cart_message' ); } /** * Remove title on Cart and Checkout pages * * @since 1.0.0 * @access public */ function capri_woocommerce_remove_title() { if ( ! is_shop() ) { return false; } } add_filter( 'woocommerce_show_page_title', 'capri_woocommerce_remove_title' );