=' ); } function shop_loop_item_title() { echo '
'. get_the_title().'
'; } function before_container() { echo '
'; } function before_single_product() { echo '
'; } function shop_title() { return false; } function after_container() { echo '
'; } function sale_flash() { return '' . esc_html__( 'Sale!', 'evolve' ) .''; } function template_loop_category_title( $category ) { ?>
name ); if ( $category->count > 0 ) { echo apply_filters( 'woocommerce_subcategory_count_html', ' (' . esc_html( $category->count ) . ')', $category ); // WPCS: XSS ok. } ?>
'; dynamic_sidebar( 'sidebar-2' ); echo '
'; } } function add_sidebar() { $sidebar_css = ''; $get_sidebar = false; if ( evolve_theme_mod( 'evl_layout', '2cl' ) != "1c" ) { $get_sidebar = true; } switch ( evolve_theme_mod( 'evl_layout', '2cl' ) ): case "1c": //do nothing break; case "2cl": $sidebar_css = 'col-sm-12 col-md-4'; break; case "2cr": $sidebar_css = 'col-sm-12 col-md-4 order-2 order-md-1'; break; case "3cm": $sidebar_css = 'col-md-12 col-lg-3 order-3'; break; case "3cl": $sidebar_css = 'col-md-12 col-lg-3 order-3'; break; case "3cr": $sidebar_css = 'col-md-12 col-lg-3 order-3 order-lg-2'; break; endswitch; if ( ( ( is_front_page() && is_page() ) || is_home() ) && is_shop() ) { if ( evolve_theme_mod( 'evl_frontpage_layout', '1c' ) == "1c" ) { $get_sidebar = false; } else { $get_sidebar = true; } switch ( evolve_theme_mod( 'evl_frontpage_layout', '1c' ) ): case "1c": $sidebar_css = ''; break; case "2cl": $sidebar_css = 'col-sm-12 col-md-4'; break; case "2cr": $sidebar_css = 'col-sm-12 col-md-4 order-2 order-md-1'; break; case "3cm": $sidebar_css = 'col-md-12 col-lg-3 order-3'; break; case "3cl": $sidebar_css = 'col-md-12 col-lg-3 order-3'; break; case "3cr": $sidebar_css = 'col-md-12 col-lg-3 order-3 order-lg-2'; break; endswitch; } if ( $get_sidebar == true ) { echo '
'; dynamic_sidebar( 'sidebar-1' ); echo '
'; } } function shop_breadcrumb() { $evolve_breadcrumbs = evolve_theme_mod( 'evl_breadcrumbs', '1' ); if ( $evolve_breadcrumbs == "1" ): woocommerce_breadcrumb(); endif; } } new evolve_woocommerce(); } add_filter( 'woocommerce_breadcrumb_defaults', 'evolve_woocommerce_breadcrumbs' ); function evolve_woocommerce_breadcrumbs() { return array( 'wrap_before' => '', 'before' => '', 'home' => __( 'Home', 'evolve' ), 'delimiter' => '' ); } add_filter( 'get_product_search_form', 'evolve_product_search_form' ); function evolve_product_search_form( $form ) { $form = ''; return $form; } remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 ); /* Category Page Show Shorting Order ======================================= */ function evolve_woocommerce_catalog_ordering() { $woo_items = evolve_theme_mod( 'evl_woo_items', '12' ); if ( isset( $_SERVER['QUERY_STRING'] ) ) { parse_str( $_SERVER['QUERY_STRING'], $params ); $query_string = '?' . $_SERVER['QUERY_STRING']; } else { $query_string = ''; } // replace it with theme option if ( $woo_items ) { $per_page = $woo_items; } else { $per_page = 12; } $pob = ! empty( $params['product_orderby'] ) ? $params['product_orderby'] : 'default'; $po = ! empty( $params['product_order'] ) ? $params['product_order'] : 'asc'; $pc = ! empty( $params['product_count'] ) ? $params['product_count'] : $per_page; $html = ''; $html .= '
'; if ( $po == 'desc' ): $html .= ''; endif; if ( $po == 'asc' ): $html .= ''; endif; $html .= ''; $html .= ''; $html .= '
'; echo $html; } function evolve_woocommerce_get_catalog_ordering_args( $args ) { global $woocommerce; if ( isset( $_SERVER['QUERY_STRING'] ) ) { parse_str( $_SERVER['QUERY_STRING'], $params ); } $pob = ! empty( $params['product_orderby'] ) ? $params['product_orderby'] : 'default'; $po = ! empty( $params['product_order'] ) ? $params['product_order'] : 'asc'; switch ( $pob ) { case 'date': $orderby = 'date'; $order = 'asc'; $meta_key = ''; break; case 'price': $orderby = 'meta_value_num'; $order = 'asc'; $meta_key = '_price'; break; case 'popularity': $orderby = 'meta_value_num'; $order = 'asc'; $meta_key = 'total_sales'; break; case 'rating': $orderby = 'meta_value_num'; $order = 'asc'; $meta_key = 'average_rating'; break; case 'name': $orderby = 'title'; $order = 'asc'; $meta_key = ''; break; case 'default': return $args; break; } switch ( $po ) { case 'desc': $order = 'desc'; break; case 'asc': $order = 'asc'; break; default: $order = 'asc'; break; } $args['orderby'] = $orderby; $args['order'] = $order; $args['meta_key'] = $meta_key; if ( $pob == 'rating' ) { $args['orderby'] = 'menu_order title'; $args['order'] = $po == 'desc' ? 'desc' : 'asc'; $args['order'] = strtoupper( $args['order'] ); $args['meta_key'] = ''; add_filter( 'posts_clauses', 'evolve_order_by_rating_post_clauses' ); } return $args; } function evolve_order_by_rating_post_clauses( $args ) { global $wpdb; $args['fields'] .= ", AVG( $wpdb->commentmeta.meta_value ) as average_rating "; $args['where'] .= " AND ( $wpdb->commentmeta.meta_key = 'rating' OR $wpdb->commentmeta.meta_key IS null ) "; $args['join'] .= " LEFT OUTER JOIN $wpdb->comments ON($wpdb->posts.ID = $wpdb->comments.comment_post_ID) LEFT JOIN $wpdb->commentmeta ON($wpdb->comments.comment_ID = $wpdb->commentmeta.comment_id) "; if ( isset( $_SERVER['QUERY_STRING'] ) ) { parse_str( $_SERVER['QUERY_STRING'], $params ); } $order = ! empty( $params['product_order'] ) ? $params['product_order'] : 'desc'; $order = strtoupper( $order ); $args['orderby'] = "sum_of_comments_approved DESC, average_rating {$order}, $wpdb->posts.post_date DESC"; $args['groupby'] = "$wpdb->posts.ID"; return $args; } add_filter( 'loop_shop_per_page', 'evolve_loop_shop_per_page' ); function evolve_loop_shop_per_page() { $woo_items = evolve_theme_mod( 'evl_woo_items', '12' ); if ( isset( $_SERVER['QUERY_STRING'] ) ) { parse_str( $_SERVER['QUERY_STRING'], $params ); } if ( $woo_items ) { $per_page = $woo_items; } else { $per_page = 12; } $pc = ! empty( $params['product_count'] ) ? $params['product_count'] : $per_page; return $pc; } add_action( 'woocommerce_before_shop_loop_item_title', 'evolve_woocommerce_thumbnail', 10 ); remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); function evolve_woocommerce_thumbnail() { global $woocommerce, $product; $items_in_cart = array(); if ( $woocommerce->cart->get_cart() && is_array( $woocommerce->cart->get_cart() ) ) { foreach ( $woocommerce->cart->get_cart() as $cart ) { $items_in_cart[] = $cart['product_id']; } } $id = $product->get_ID(); $in_cart = in_array( $id, $items_in_cart ); $size = 'shop_catalog'; $gallery = get_post_meta( $id, '_product_image_gallery', true ); $attachment_image = ''; if ( ! empty( $gallery ) ) { $gallery = explode( ',', $gallery ); $first_image_id = $gallery[0]; $image_title = esc_attr( get_the_title( $first_image_id ) ); $attachment_image = wp_get_attachment_image( $first_image_id, $size, false, array( 'class' => 'hover-image card-img-top', "alt" => $image_title ) ); } $image_title = esc_attr( get_the_title( get_post_thumbnail_id() ) ); $thumb_image = get_the_post_thumbnail( $id, $size, array( "class" => "card-img-top", "alt" => $image_title ) ); if ( !has_post_thumbnail() ) { $thumb_image = woocommerce_get_product_thumbnail( $size ); } if ( empty( $thumb_image ) ) { $thumb_image = ''.esc_html__( 'Awaiting product image', 'evolve' ) .''; } if ( $attachment_image ) { $class_1 = '
'; $class_2 = '
'; } else { $class_1 = ''; $class_2 = ''; } echo $class_1; echo $attachment_image; echo $thumb_image; if ( $in_cart ) { echo '
'; } else { echo '
'; } echo '
' . evolve_get_svg( 'search' ) . __( 'Show details', 'evolve' ) . '
'; echo $class_2; } add_filter( 'woocommerce_add_to_cart_fragments', 'evolve_woocommerce_header_add_to_cart_fragment' ); function evolve_woocommerce_header_add_to_cart_fragment( $fragments ) { global $woocommerce; ob_start(); ?> 4, 'columns' => 4, 'orderby' => 'rand' ); woocommerce_related_products( apply_filters( 'woocommerce_output_related_products_args', $args ) ); } add_action( 'woocommerce_before_cart_table', 'evolve_woocommerce_before_cart_table', 20 ); function evolve_woocommerce_before_cart_table( $args ) { global $woocommerce; $html = '
'; $html .= '

' . sprintf( _n( 'You have %s item in your cart', 'You have %s items in your cart', $woocommerce->cart->cart_contents_count, 'evolve' ), $woocommerce->cart->cart_contents_count ) . '

'; echo $html; } add_action( 'woocommerce_after_cart_table', 'evolve_woocommerce_after_cart_table', 20 ); function evolve_woocommerce_after_cart_table( $args ) { $html = '
'; echo $html; } function evolve_woocommerce_cross_sell_display_2( $posts_per_page = 3, $columns = 3, $orderby = 'rand' ) { // Get visible cross sells then sort them at random. $cross_sells = array_filter( array_map( 'wc_get_product', WC()->cart->get_cross_sells() ), 'wc_products_array_filter_visible' ); wc_set_loop_prop( 'name', 'cross-sells' ); wc_set_loop_prop( 'columns', apply_filters( 'woocommerce_cross_sells_columns', $columns ) ); $cross_sells = $posts_per_page > 0 ? array_slice( $cross_sells, 0, $posts_per_page ) : $cross_sells; wc_get_template( 'cart/cross-sells.php', array( 'cross_sells' => $cross_sells, 'posts_per_page' => $posts_per_page, 'orderby' => $orderby, 'columns' => $columns ) ); } function evolve_cart_shipping_calc() { global $woocommerce; if ( 'no' === get_option( 'woocommerce_enable_shipping_calc' ) || ! WC()->cart->needs_shipping() ) { return; } do_action( 'woocommerce_before_shipping_calculator' ); ?>

customer->get_shipping_country(); $current_r = WC()->customer->get_shipping_state(); $states = WC()->countries->get_states( $current_cc ); if ( is_array( $states ) && empty( $states ) ) { ?>

cart->coupons_enabled() ) { ?>

cart->get_cross_sells(); if ( sizeof( $crosssells ) == 0 ) { return; } $number_of_columns = 4; woocommerce_cross_sell_display( apply_filters( 'woocommerce_cross_sells_total', - 1 ), $number_of_columns ); } remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 ); /* Add Bootstrap Style To The WooCommerce Fields ======================================= */ add_filter( 'woocommerce_form_field_args', 'evolve_wc_form_field_args', 10, 3 ); function evolve_wc_form_field_args( $args, $key, $value = null ) { // Start field type switch case switch ( $args['type'] ) { case 'select' : /* Targets all select input type elements, except the country and state select input types */ $args['class'][] = 'form-group'; // Add a class to the field's html element wrapper - woocommerce input types (fields) are often wrapped within a

tag $args['input_class'] = array( 'form-control' ); // Add a class to the form input itself //$args['custom_attributes']['data-plugin'] = 'select2'; $args['label_class'] = array( 'col-sm-4 col-form-label' ); $args['custom_attributes'] = array( 'data-plugin' => 'select2', 'data-allow-clear' => 'true', 'aria-hidden' => 'true', ); // Add custom data attributes to the form input itself break; case 'country' : /* By default WooCommerce will populate a select with the country names - $args defined for this specific input type targets only the country select element */ $args['class'][] = 'form-group single-country'; $args['label_class'] = array( 'col-sm-4 col-form-label' ); break; case 'state' : /* By default WooCommerce will populate a select with state names - $args defined for this specific input type targets only the country select element */ $args['class'][] = 'form-group'; // Add class to the field's html element wrapper $args['input_class'] = array( 'form-control' ); // add class to the form input itself //$args['custom_attributes']['data-plugin'] = 'select2'; $args['label_class'] = array( 'col-sm-4 col-form-label' ); $args['custom_attributes'] = array( 'data-plugin' => 'select2', 'data-allow-clear' => 'true', 'aria-hidden' => 'true', ); break; case 'text': case 'password': case 'datetime': case 'datetime-local': case 'date': case 'month': case 'time': case 'week': case 'number': case 'email': case 'url': case 'tel': $args['class'][] = 'form-group'; $args['input_class'] = array( 'form-control' ); $args['label_class'] = array( 'col-sm-4 col-form-label' ); break; case 'textarea' : $args['input_class'] = array( 'form-control' ); $args['label_class'] = array( 'col-sm-4 col-form-label' ); break; case 'checkbox' : $args['class'][] = 'custom-control custom-checkbox'; $args['input_class'] = array( 'custom-control-input' ); $args['label_class'] = array( 'custom-control-label' ); break; case 'radio' : $args['class'][] = 'custom-control custom-radio'; $args['input_class'] = array( 'custom-control-input' ); $args['label_class'] = array( 'custom-control-label' ); break; default : $args['class'][] = 'form-group'; $args['input_class'] = array( 'form-control' ); $args['label_class'] = array( 'col-sm-4 col-form-label' ); break; } return $args; } $evolve_woocommerce_option = get_option( 'evl_options' ); $evolve_woocommerce_one_page_checkout = isset( $evolve_woocommerce_option['evl_evolve_woocommerce_one_page_checkout'] ) ? $evolve_woocommerce_option['evl_evolve_woocommerce_one_page_checkout'] : ''; if ( $evolve_woocommerce_one_page_checkout != '1' ) { add_action( 'woocommerce_before_checkout_form', 'evolve_woocommerce_before_checkout_form' ); } function evolve_woocommerce_before_checkout_form( $args ) { global $woocommerce; ?>
cart->needs_shipping() && ! wc_ship_to_billing_address_only() || apply_filters( 'woocommerce_enable_order_notes_field', get_option( 'woocommerce_enable_order_comments', 'yes' ) === 'yes' ) && ( ! WC()->cart->needs_shipping() || wc_ship_to_billing_address_only() ) ) { return; } else { ?>
cart->needs_shipping() && ! wc_ship_to_billing_address_only() || apply_filters( 'woocommerce_enable_order_notes_field', get_option( 'woocommerce_enable_order_comments', 'yes' ) === 'yes' ) && ( ! WC()->cart->needs_shipping() || wc_ship_to_billing_address_only() ) ) { ?>
7438 882 764' ); $evolve_woo_acc_msg_2 = evolve_theme_mod( 'evl_woo_acc_msg_2', 'Email us - contact@example.com' ); ?>

display_name ); ?>

', esc_html( $current_user->display_name ), '', '', '' ); ?>

', '', '', '

'; } add_action( 'woocommerce_account_downloads', 'evolve_woocommerce_before_account_downloads' ); function evolve_woocommerce_before_account_downloads( $args ) { echo '
'; if ( $downloads = WC()->customer->get_downloadable_products() ) : do_action( 'woocommerce_before_available_downloads' ); ?>

'; echo apply_filters( 'woocommerce_available_download_link', '' . evolve_get_svg( 'download' ) . $download['download_name'] . '', $download ); if ( is_numeric( $download['downloads_remaining'] ) ) { $downloads_remaining = $download['downloads_remaining']; echo apply_filters( 'woocommerce_available_download_count', '' . sprintf( _n( '%s download remaining', '%s downloads remaining', $downloads_remaining, 'evolve' ), $download['downloads_remaining'] ) . ' ', $download ); } echo '

'; do_action( 'woocommerce_available_download_end', $download ); ?>
'; } add_action( 'woocommerce_account_address', 'evolve_woocommerce_before_my_account' ); function evolve_woocommerce_before_my_account( $args ) { $address_session = ''; if ( isset( $_SESSION['formvalue'] ) ) { $address_session = 'style="display:block"'; } ?>
>

>

__( 'Billing address', 'evolve' ), 'shipping' => __( 'Shipping address', 'evolve' ) ), $customer_id ); $col = '2'; } else { $get_addresses = apply_filters( 'woocommerce_my_account_get_addresses', array( 'billing' => __( 'Billing address', 'evolve' ) ), $customer_id ); $col = '1'; } ?>

$title ) : ?>
get_user_meta( $customer_id, $name . '_first_name', true ), 'last_name' => get_user_meta( $customer_id, $name . '_last_name', true ), 'company' => get_user_meta( $customer_id, $name . '_company', true ), 'address_1' => get_user_meta( $customer_id, $name . '_address_1', true ), 'address_2' => get_user_meta( $customer_id, $name . '_address_2', true ), 'city' => get_user_meta( $customer_id, $name . '_city', true ), 'state' => get_user_meta( $customer_id, $name . '_state', true ), 'postcode' => get_user_meta( $customer_id, $name . '_postcode', true ), 'country' => get_user_meta( $customer_id, $name . '_country', true ) ), $customer_id, $name ); $formatted_address = WC()->countries->get_formatted_address( $address ); if ( ! $formatted_address ) { _e( 'You have not set up this type of address yet', 'evolve' ); } else { echo $formatted_address; } ?>
countries->get_address_fields( get_user_meta( get_current_user_id(), $load_address . '_country', true ), $load_address . '_' ); // Prepare values foreach ( $address as $key => $field ) { $value = get_user_meta( get_current_user_id(), $key, true ); if ( ! $value ) { switch ( $key ) { case 'billing_email' : case 'shipping_email' : $value = $current_user->user_email; break; case 'billing_country' : case 'shipping_country' : $value = WC()->countries->get_base_country(); break; case 'billing_state' : case 'shipping_state' : $value = WC()->countries->get_base_state(); break; } } $address[ $key ]['value'] = apply_filters( 'woocommerce_my_account_edit_address_field_value', $value, $key, $load_address ); $addressform_session = ''; if ( isset( $_SESSION['formvalue'] ) && ! empty( $field['required'] ) && isset( $_POST[ $key ] ) ) { $addressform_session = 'style=display:block'; } elseif ( isset( $_SESSION['formvalue'] ) ) { $addressform_session = 'style=display:none'; } } ?>

>

>
$field ) : woocommerce_form_field( $key, $field, ! empty( $_POST[ $key ] ) ? wc_clean( $_POST[ $key ] ) : $field['value'] ); endforeach; ?>

countries->get_address_fields( get_user_meta( get_current_user_id(), $load_address . '_country', true ), $load_address . '_' ); // Prepare values foreach ( $address as $key => $field ) { $value = get_user_meta( get_current_user_id(), $key, true ); if ( ! $value ) { switch ( $key ) { case 'billing_email' : case 'shipping_email' : $value = $current_user->user_email; break; case 'billing_country' : case 'shipping_country' : $value = WC()->countries->get_base_country(); break; case 'billing_state' : case 'shipping_state' : $value = WC()->countries->get_base_state(); break; } } $address[ $key ]['value'] = apply_filters( 'woocommerce_my_account_edit_address_field_value', $value, $key, $load_address ); $addressform_session = ''; if ( isset( $_SESSION['formvalue'] ) && ! empty( $field['required'] ) && isset( $_POST[ $key ] ) ) { $addressform_session = 'style=display:block'; } elseif ( isset( $_SESSION['formvalue'] ) ) { $addressform_session = 'style=display:none'; } } ?>

>

>
$field ) : woocommerce_form_field( $key, $field, ! empty( $_POST[ $key ] ) ? wc_clean( $_POST[ $key ] ) : $field['value'] ); endforeach; ?>

countries->get_address_fields( esc_attr( $_POST[ $load_address . '_country' ] ), $load_address . '_' ); foreach ( $address as $key => $field ) { if ( ! isset( $field['type'] ) ) { $field['type'] = 'text'; } // Get Value. switch ( $field['type'] ) { case 'checkbox' : $_POST[ $key ] = isset( $_POST[ $key ] ) ? 1 : 0; break; default : $_POST[ $key ] = isset( $_POST[ $key ] ) ? wc_clean( $_POST[ $key ] ) : ''; break; } // Hook to allow modification of value. $_POST[ $key ] = apply_filters( 'woocommerce_process_myaccount_field_' . $key, $_POST[ $key ] ); // Validation: Required fields. if ( ! empty( $field['required'] ) && empty( $_POST[ $key ] ) ) { wc_add_notice( $field['label'] . ' ' . __( 'is a required field.', 'evolve' ), 'error' ); } if ( ! empty( $_POST[ $key ] ) ) { // Validation rules if ( ! empty( $field['validate'] ) && is_array( $field['validate'] ) ) { foreach ( $field['validate'] as $rule ) { switch ( $rule ) { case 'postcode' : $_POST[ $key ] = strtoupper( str_replace( ' ', '', $_POST[ $key ] ) ); if ( ! WC_Validation::is_postcode( $_POST[ $key ], $_POST[ $load_address . '_country' ] ) ) { wc_add_notice( __( 'Please enter a valid postcode/ZIP.', 'evolve' ), 'error' ); } else { $_POST[ $key ] = wc_format_postcode( $_POST[ $key ], $_POST[ $load_address . '_country' ] ); } break; case 'phone' : $_POST[ $key ] = wc_format_phone_number( $_POST[ $key ] ); if ( ! WC_Validation::is_phone( $_POST[ $key ] ) ) { wc_add_notice( '' . $field['label'] . ' ' . __( 'is not a valid phone number.', 'evolve' ), 'error' ); } break; case 'email' : $_POST[ $key ] = strtolower( $_POST[ $key ] ); if ( ! is_email( $_POST[ $key ] ) ) { wc_add_notice( '' . $field['label'] . ' ' . __( 'is not a valid email address.', 'evolve' ), 'error' ); } break; } } } } } if ( wc_notice_count( 'error' ) == 0 ) { foreach ( $address as $key => $field ) { update_user_meta( $user_id, $key, $_POST[ $key ] ); } wc_add_notice( __( 'Address changed successfully.', 'evolve' ) ); do_action( 'woocommerce_customer_save_address', $user_id, $load_address ); wp_safe_redirect( wc_get_page_permalink( 'myaccount' ) ); exit; } } } evolve_WC_Form_Handler::init(); add_action( 'woocommerce_account_editaccount', 'evolve_woocommerce_after_my_account' ); function evolve_woocommerce_after_my_account( $args ) { global $woocommerce, $wp; $user = wp_get_current_user(); ?>

get_order_item_totals() ) { foreach ( $totals as $total ) : ?> get_items() ) > 0 ) { foreach ( $order->get_items() as $item ) { $_product = apply_filters( 'woocommerce_order_item_product', $order->get_product_from_item( $item ), $item ); $product = apply_filters( 'woocommerce_order_item_product', $item->get_product(), $item ); ?> has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', array( 'completed', 'processing' ) ) ); $purchase_note = $product ? $product->get_purchase_note() : ''; if ( $show_purchase_note && $purchase_note ) { ?>
 
get_image(), $cart_item, $cart_item_key ); if ( ! $_product->is_visible() ) { echo $thumbnail; } else { printf( '%s', $_product->get_permalink(), $thumbnail ); } ?> get_formatted_line_subtotal( $item ); ?>

get_customer_note() ) { echo '
' . __( 'Note:', 'evolve' ) . '
' . $order->get_customer_note() . '
'; } if ( $order->get_billing_email() ) { echo '
' . __( 'Email:', 'evolve' ) . '
' . $order->get_billing_email() . '
'; } if ( $order->get_billing_phone() ) { echo '
' . __( 'Telephone:', 'evolve' ) . '
' . $order->get_billing_phone() . '
'; } do_action( 'woocommerce_order_details_after_customer_details', $order ); ?>

get_formatted_billing_address() ) { _e( 'N/A', 'evolve' ); } else { echo $order->get_formatted_billing_address(); } ?>

get_formatted_shipping_address() ) { _e( 'N/A', 'evolve' ); } else { echo $order->get_formatted_shipping_address(); } ?>

'product', 'posts_per_page' => 1, 'no_found_rows' => 1, 'post_status' => 'publish', 'meta_query' => array( array( 'key' => '_visibility', 'value' => array( 'catalog', 'visible' ), 'compare' => 'IN' ) ), 'columns' => 1 ); if ( isset( $atts['sku'] ) ) { $args['meta_query'][] = array( 'key' => '_sku', 'value' => $atts['sku'], 'compare' => '=' ); } if ( isset( $atts['id'] ) ) { $args['p'] = $atts['id']; } ob_start(); if ( isset( $columns ) ) { $woocommerce_loop['columns'] = $columns; } $products = new WP_Query( $args ); if ( $products->have_posts() ) : woocommerce_product_loop_start(); while ( $products->have_posts() ) : $products->the_post(); woocommerce_get_template_part( 'content', 'product' ); endwhile; // end of the loop. woocommerce_product_loop_end(); endif; wp_reset_postdata(); return '
' . ob_get_clean() . '
'; } /* Function To Print Out CSS Class For Single Product According To Layout ======================================= */ function evolve_single_product_class() { $layout_css = ''; switch ( evolve_theme_mod( 'evl_layout', '2cl' ) ): case "1c": case "2cl": case "2cr": $layout_css = 'col-md-6'; break; case "3cm": case "3cl": case "3cr": $layout_css = 'col-md-12'; break; endswitch; echo $layout_css; } /* WooCommerce Add URL Parameter ======================================= */ if ( ! function_exists( 'evolve_addURLParameter' ) ) { function evolve_addURLParameter( $url, $paramName, $paramValue ) { $url_data = parse_url( $url ); if ( ! isset( $url_data["query"] ) ) { $url_data["query"] = ""; } $params = array(); parse_str( $url_data['query'], $params ); $params[ $paramName ] = $paramValue; if ( $paramName == 'product_count' ) { $params['paged'] = '1'; } $url_data['query'] = http_build_query( $params ); return evolve_build_url( $url_data ); } } function evolve_build_url( $url_data ) { $url = ""; if ( isset( $url_data['host'] ) ) { $url .= $url_data['scheme'] . '://'; if ( isset( $url_data['user'] ) ) { $url .= $url_data['user']; if ( isset( $url_data['pass'] ) ) { $url .= ':' . $url_data['pass']; } $url .= '@'; } $url .= $url_data['host']; if ( isset( $url_data['port'] ) ) { $url .= ':' . $url_data['port']; } } if ( isset( $url_data['path'] ) ) { $url .= $url_data['path']; } if ( isset( $url_data['query'] ) ) { $url .= '?' . $url_data['query']; } if ( isset( $url_data['fragment'] ) ) { $url .= '#' . $url_data['fragment']; } return $url; } /* WooCommerce My Account / Cart Menu ======================================= */ if ( !function_exists( 'evolve_woocommerce_menu' ) ) { function evolve_woocommerce_menu() { if ( evolve_theme_mod( 'evl_woocommerce_acc_link_main_nav', 0 ) == "0" && evolve_theme_mod( 'evl_woocommerce_cart_link_main_nav', 0 ) == "0" ) { return; } global $woocommerce; ?>