• Resolved stefanfis

    (@stefanfis)


    We’ve implemented a shop using Woocommerce and it works great. Now we got a new requirement: We should include products from an external provider using their API. Those are “real” (e.g. no digital) products and are not listed in our WP backend. It should be possible for customers to buy “our” products from our shop as well as products from that other source that is just integrated via the API. So the “External Product” type does not help us.

    We’ve experimented with adding a dummy product and tried to use “woocommerce_add_cart_item_data” and “woocommerce_before_calculate_totals” to update informations on-the-fly, but that doesn’t work either.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    Hey there!

    Are you just trying to import products using their API, or are you trying to do something different?

    Thread Starter stefanfis

    (@stefanfis)

    The external products should not be imported into the Woocommerce backend. The idea is something like this:
    – We get the product details via API and show them in our shop, on category pages as well as on product detail pages. (This is easy and not our problem.)
    – When a user wants to buy such an API product it should be added to the cart while fetching price and other details from that API, not from the Woocommerce backend.
    – It should be possible to buy products from our shop (products in our backend) as well as products from that external source (not in our backend) as a single purchase.

    I am trying to do this too but nobody helps!!

    I have been tasked to do something similar.
    Did you solve your problems?

    I was thinking of creating a “placeholder” product in woocommerce and then attach all the attributes I get from the external API to it (title, price, quantity, SKU etc.).

    It’s surprisingly difficult to find some conclusive info on this.

    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    @stefanfis This is not something WooCommerce is able to do without either custom development or an additional plugin. WooCommerce works with products that are in the database and has no way to fetch additional products via an API to allow customers to purchase them. If the product was not entered into the store itself, there would be no way to properly reference it for orders, reporting, etc.

    It almost sounds more like you need a drop shipping plugin where the items are in the store, but get fulfilled by third parties.

    Setting this to resolved since it is out of scope.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Integrate External Products using an API’ is closed to new replies.