Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter iworys

    (@iworys)

    On my domain shop.myproject.com I have wordpress running with woocomerce and your plugin.

    On myproject.com domain I have VueJS application with products.

    My idea is that every visitor of the site can make a purchase without registration.
    I would add products to the cart through your plugin (CoCart.post(“cart/add-item”, data)…?).
    When he wants to complete the order, I would send him to shop.myproject.com directly to the cart where he could complete the order.

    Now I have a follow-up experiment:

    
    const coCart = new CoCartAPI({
       url: "https://shop.myproject.com",
       consumerKey: 'ck_acf0ac0906c...8', // required
       consumerSecret: 'cs_ce9f6123...22, // required
    });

    (consumerKey, consumerSecret) are required and bound to the user registered in the e-shop.

    Add to cart:

    
    const data = {"quantity": "1", "id": "12"}
    coCart.post("cart/add-item", data) // returns cart_key "1"
    

    Load cart:
    coCart.get("cart/items", {"cart_key": "1" }) // return error code 403

    I don’t know if I’m doing everything right and if it’s even possible to achieve my idea.
    If I need to buy a plugin, I have no problem, but I don’t know if it will help.

    Thank you for an answer

    Thread Starter iworys

    (@iworys)

    Thank you, but the API initialization wants some user’s authorization keys and then stores everything against that account. That doesn’t sound like unauthorized access to me.

Viewing 2 replies - 1 through 2 (of 2 total)