".__($plugin_path.'templates/template'.$template.'/cart.php'.' Cart template does not exist!','acl-floating-cart')."
";
}
//$content = ob_get_clean();
//return $content;
?>
cart->get_cart();
$itemCount = count($items);
if ($itemCount >= 1) {
$html .= '';
foreach ($items as $item => $values) {
$_product = apply_filters('woocommerce_cart_item_product', $values['data'], $values, $item);
$product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $values ) : '', $values, $item );
$html .= '
';
$html .='
';
$thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $values, $item );
if ( ! $product_permalink ) {
$html .=$thumbnail; // PHPCS: XSS ok.
} else {
$html .=sprintf( '
%s', esc_url( $product_permalink ), $thumbnail ); // PHPCS: XSS ok.
}
$html.='
';
$html .='
';
if ( ! $product_permalink ) {
$html.= wp_kses_post( apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $values, $item ) . ' ' );
} else {
$html.= wp_kses_post( apply_filters( 'woocommerce_cart_item_name', sprintf( '
%s', esc_url( $product_permalink ), $_product->get_name() ), $values, $item ) );
}
do_action( 'woocommerce_after_cart_item_name', $values, $item );
// Meta data.
$html.= wc_get_formatted_cart_item_data( $values ); // PHPCS: XSS ok.
// Backorder notification.
if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $values['quantity'] ) ) {
$html.= wp_kses_post( apply_filters( 'woocommerce_cart_item_backorder_notification', '
' . esc_html__( 'Available on backorder', 'woocommerce' ) . '
', $values['product_id'] ) );
}
$html .= '
';
$html .= '
-
';
$html .= '
';
$html .= '
+
';
$html .= '
';
$html.='
';
$html .= '
' . apply_filters('woocommerce_cart_item_price', WC()->cart->get_product_price($_product), $values, $item) . '
';
}
} else {
// focawo_cart_lang_cart_total
if(isset($focawo_cart_lang_no_products) && $focawo_cart_lang_no_products != '' ){
$html .= '
'.$focawo_cart_lang_no_products.'
';
}else{
$html .= '
'.__('No products in the cart','acl-floating-cart').'
';
}
}
$response=array('html'=>$html,'items'=>$itemCount, 'cart_total'=>$woocommerce->cart->get_cart_total());
echo wp_send_json($response);
wp_die();
}
public function cart_item_remove(){
//getting cart items n
global $woocommerce;
$cart_item_key = wc_clean($_POST['cart_item']);
$result = $woocommerce->cart->remove_cart_item($cart_item_key);
echo wp_send_json($result);
wp_die();
}
public function update_cart_item_number(){
//getting cart items
$cart_item_key = wc_clean($_POST['cart_item_key']);
$qnty = empty( $_POST['qnty'] ) ? 1 : apply_filters( 'woocommerce_stock_amount', wc_clean($_POST['qnty']));
global $woocommerce;
$result = $woocommerce->cart->set_quantity($cart_item_key, $qnty);
echo wp_send_json($result);
wp_die();
}
public function custom_style(){
if (get_option('acl_focawo_custom_css') != "") {
?>