> $this->get_item_responses_from_schema( $this->item_schema, $cart->get_cart() ),
'coupons' => $this->get_item_responses_from_schema( $this->coupon_schema, $cart->get_applied_coupons() ),
'fees' => $this->get_item_responses_from_schema( $this->fee_schema, $cart->get_fees() ),
'totals' => (object) $this->prepare_currency_response( $this->get_totals( $cart ) ),
'shipping_address' => (object) $this->shipping_address_schema->get_item_response( wc()->customer ),
'billing_address' => (object) $this->billing_address_schema->get_item_response( wc()->customer ),
'needs_payment' => $cart->needs_payment(),
'needs_shipping' => $cart->needs_shipping(),
'payment_requirements' => $this->extend->get_payment_requirements(),
'has_calculated_shipping' => $has_calculated_shipping,
'shipping_rates' => $this->get_item_responses_from_schema( $this->shipping_rate_schema, $shipping_packages ),
'items_count' => $cart->get_cart_contents_count(),
'items_weight' => wc_get_weight( $cart->get_cart_contents_weight(), 'g' ),
'cross_sells' => $this->get_item_responses_from_schema( $this->cross_sells_item_schema, $cross_sells ),
'errors' => $cart_errors,
'payment_methods' => array_values( wp_list_pluck( WC()->payment_gateways->get_available_payment_gateways(), 'id' ) ),
self::EXTENDING_KEY => $this->get_extended_data( self::IDENTIFIER ),
];
}
/**
* Get total data.
*
* @param \WC_Cart $cart Cart class instance.
* @return array
*/
protected function get_totals( $cart ) {
$has_calculated_shipping = $cart->show_shipping();
$decimals = wc_get_price_decimals();
return [
'total_items' => $this->prepare_money_response( $cart->get_subtotal(), $decimals ),
'total_items_tax' => $this->prepare_money_response( $cart->get_subtotal_tax(), $decimals ),
'total_fees' => $this->prepare_money_response( $cart->get_fee_total(), $decimals ),
'total_fees_tax' => $this->prepare_money_response( $cart->get_fee_tax(), $decimals ),
'total_discount' => $this->prepare_money_response( $cart->get_discount_total(), $decimals ),
'total_discount_tax' => $this->prepare_money_response( $cart->get_discount_tax(), $decimals ),
'total_shipping' => $has_calculated_shipping ? $this->prepare_money_response( $cart->get_shipping_total(), $decimals ) : null,
'total_shipping_tax' => $has_calculated_shipping ? $this->prepare_money_response( $cart->get_shipping_tax(), $decimals ) : null,
// Explicitly request context='edit'; default ('view') will render total as markup.
'total_price' => $this->prepare_money_response( $cart->get_total( 'edit' ), $decimals ),
'total_tax' => $this->prepare_money_response( $cart->get_total_tax(), $decimals ),
'tax_lines' => $this->get_tax_lines( $cart ),
];
}
/**
* Get tax lines from the cart and format to match schema.
*
* @param \WC_Cart $cart Cart class instance.
* @return array
*/
protected function get_tax_lines( $cart ) {
$tax_lines = [];
if ( 'itemized' !== get_option( 'woocommerce_tax_total_display' ) ) {
return $tax_lines;
}
$cart_tax_totals = $cart->get_tax_totals();
$decimals = wc_get_price_decimals();
foreach ( $cart_tax_totals as $cart_tax_total ) {
$tax_lines[] = array(
'name' => $cart_tax_total->label,
'price' => $this->prepare_money_response( $cart_tax_total->amount, $decimals ),
'rate' => WC_Tax::get_rate_percent( $cart_tax_total->tax_rate_id ),
);
}
return $tax_lines;
}
/**
* Get cart validation errors.
*
* @param \WC_Cart $cart Cart class instance.
* @return array
*/
protected function get_cart_errors( $cart ) {
$controller = new CartController();
$errors = $controller->get_cart_errors();
$cart_errors = [];
foreach ( (array) $errors->errors as $code => $messages ) {
foreach ( (array) $messages as $message ) {
$cart_errors[] = new \WP_Error(
$code,
$message,
$errors->get_error_data( $code )
);
}
}
return array_values( array_map( [ $this->error_schema, 'get_item_response' ], $cart_errors ) );
}
}
Huawei Honor 8 book case – alibabatelecom
View cart “Iphone 7 Plus, 8 Plus book case” has been added to your cart.
Huawei Honor 8 book case 279.57 €
AMA book case is the high-quality faux premuim case with built-in stand function and inside pockets for cards and documents.
inside of the case is silicone and it is not going broke when you lose your phone
It combines elegant colours and is equipped with a hard shell to ensure the stability and protection of your Smartphone.
Color
Brown
Huawei Honor Models
Huawei Honor 8
30 in stock
Description
AMA book case is the high-quality faux premuim case with built-in stand function and inside pockets for cards and documents.
inside of the case is silicone and it is not going broke when you lose your phone
It combines elegant colours and is equipped with a hard shell to ensure the stability and protection of your Smartphone.