I want to remove the currency code from get-cart api. Also, I am using Wp-api method to get cart but cart is not returning cart-key and cart-hash key.
Here is my code
function get_cart_val(){
$data = array();
$response = wp_remote_get( 'https://www.orocult.com/wp-json/cocart/v1/get-cart' );
$body = wp_remote_retrieve_body( $response );
$cart = json_decode($body);
I want to remove the currency code from get-cart api. Also, I am using Wp-api method to get cart but cart is not returning cart-key and cart-hash key. Here is my code function get_cart_val(){ $data = array(); $response = wp_remote_get( 'https://www.orocult.com/wp-json/cocart/v1/get-cart' ); $body = wp_remote_retrieve_body( $response ); $cart = json_decode($body);
$test['currency'] = $cart->currency; $test['cart_key'] = $cart->cart_key; $test['cart_hash'] = $cart->cart_hash; $test['item_count'] = $cart->item_count; $test['needs_shipping'] = $cart->needs_shipping; $test['needs_payment'] = $cart->needs_payment;
$data[] = $test; $final_data = array('code'=>200,'message'=>'Cart listing!!','data'=>array('data'=>$data)); return new WP_REST_Response($final_data,200); }