cocart-headless / cocart-get-cart-enhanced

This free add-on enhances the cart response by returning additional data for both the cart and the items added to it.
https://wordpress.org/plugins/cocart-get-cart-enhanced/
GNU General Public License v3.0
6 stars 2 forks source link

How can I remove currency code from get cart totals #3

Closed Ritu8 closed 3 years ago

Ritu8 commented 3 years ago

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); }

seb86 commented 3 years ago

Issues posted on the GitHub repo are for reporting bugs or requesting enhancements. If you need support, please use the appropriate channel.

Thank you.