• Resolved devvlop

    (@devvlop)


    Hey,

    How can I create key? And how can I get key for View Cart Items?

    Can you explanation about this?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Sébastien Dumont

    (@sebd86)

    Hi @devvlop

    Key? There is no key to view cart items. See documentation.

    So without key in cart,We can see all of items users added to cart.
    Or Is different for each user?

    Plugin Author Sébastien Dumont

    (@sebd86)

    Different for each user.

    devvlop

    (@devvlop)

    Sorry, but is not different! I have my app on two devices and when I add one thing to cart in another device I can see in the cart.

    • This reply was modified 8 months ago by  devvlop.

    Any idea?

    Plugin Author Sébastien Dumont

    (@sebd86)

    Can you tell me if you are logged in to the same account on your app on both devices?

    My mistake is I put consumer_key and consumer_secret after requests.

    Now When I add an item to cart working fine(I see correct response), but when I see cart page I can’t see any item and response is [] .

    Plugin Author Sébastien Dumont

    (@sebd86)

    Can you please share the steps to reproduce and what language are you using with the API?

    I use fetch in react native. When I put consumer_key after url working but without consumer_key and consumer_secret I have nothing in Cart.

        return fetch('https://--------/wp-json/wc/v2/cart/',{
          method:'GET',
          headers:{
            'Content-type':'application/json',
          },
        })
    

    Add a product to cart: (Response is true and working and problem is not about add to cart)

      fetch('https://--------/wp-json/wc/v2/cart/add',{
            method:'POST',
            headers:{
              'Accept':'application/json',
              'Content-type':'application/json',
            },
            body:JSON.stringify({
              product_id:this.state.productId,
              quantity:this.state.quantity
            })
          })
    
    Plugin Author Sébastien Dumont

    (@sebd86)

    I’m sorry that it is not working for you @devvlop

    I am working on making it better to get the cart. I’m not familiar with the language React Native so at this point I don’t know how to respond.

    I don’t know why it would be empty if you use your app as a guess customer. This is something I am looking at.

    regards,

    Sébastien.

    Is there no way to add a product with username?
    Like admin when I use key I can add product to cart, and when I go to Cart I can see products.
    I have no Guest.

    Plugin Author Sébastien Dumont

    (@sebd86)

    @devvlop If you dont do guest customers then yes you can use the authentication with or without any of the official libaries WooCommerce provides.

    hi!

    we have the same problem.

    http://prntscr.com/npvc7f – we have two requests on screenshot.
    first return success after adding a good
    second return that cart has 0 goods 🙁

    request for adding a product http://prntscr.com/npvd4r

    any ideas how to fix it?

Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.