芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/public_html/ebpt.pulsehost.co.uk/wp-content/plugins/lte-ext/inc/minicart.php
cart ) ) { // WC()->cart = new WC_Cart(); return false; } if ( !empty(WC()->cart->get_cart()) ) { foreach ( WC()->cart->get_cart() as $key => $item ) { $product = $item['data']; if (!empty($product->get_parent_id())) { $product_item = new WC_Product_Variable( $product->get_parent_id() ); } else { $product_item = new WC_Product( $product->get_id() ); } $price = $product_item->get_price_html(); $out[] = '
'; $out[] = '
'; $out[] = '
'; $image = wp_get_attachment_image_src( get_post_thumbnail_id( $product->get_id() ) ); if ( !empty($image) ) $out[] = '
'; $out[] = '
'; $qty = $item['quantity']; $subtotal = $item['line_subtotal']; $item_price = $item['line_subtotal'] / $item['quantity']; $out[] = '
'; $out[] = '
'.esc_html($product->get_name()).'
'; $out[] = '
'.esc_html($item['quantity']).'
×
'.$price.'
'; $out[] = '
'; $out[] = '
'; } $out[] = '
'; $out[] = '
'.esc_html__( 'Total:', 'lte-ext' ).'
'.WC()->cart->get_total().'
'; if (function_exists('wc_get_cart_url')) { $out[] = lte_button_sc([ 'header' => esc_html__( 'View cart', 'lte-ext' ), 'href' => wc_get_cart_url(), 'color' => 'black', 'hover' => 'main', /* 'size' => 'xs',*/ ]); } $out[] = '
'; } else { $out[] = '
'.esc_html__( 'Your cart is currently empty.', 'lte-ext' ).'
'; } return implode($out); } }