Woocommerce-admin: Onboarding: Update product slugs to product IDs in product types

Created on 17 Jul 2019  路  3Comments  路  Source: woocommerce/woocommerce-admin

Seems like the product IDs will be a safer option to both grab products from the WCCOM API and also pre-fill the WCCOM cart later on based on the discussion in https://github.com/Automattic/woocommerce.com/issues/6067.

https://github.com/Automattic/woocommerce.com/pull/6131 adds in the ID to the response from WCCOM so we can use that to determine prices and product descriptions in the profiler in get_allowed_product_types().

onboarding

Most helpful comment

We are having multiple issues bundles and are thinking about possibly re-architecting the way they work. For this reason, bundles will not be supported by the initial version of this API.

cc @alanabweinstein @mattyza @haszari

All 3 comments

Posting for visibility:

The proposed API:

https://woocommerce.test/cart/?wccom-cart=390890,27147&wccom-site=https://biz.test&wccom-back=https://biz.test/admin

Product ids => wccom-cart=390890,27147
Site so we know where they are coming from => wccom-site=https://biz.test
Back so we know where to take them to => wccom-back=https://biz.test/admin

PR for adding this new endpoint:
https://github.com/Automattic/woocommerce.com/pull/6134

@joshuatf After some chats in our team we've settled on this final url structure:

https://woocommerce.test/cart/?wccom-replace-with=1907128,1922995,1822936,1822936,1770503

The comma can be URL encoded to %2c.

Note that this is limited to the cart page and will redirect the user to the checkout after adding n number of products.

We are having multiple issues bundles and are thinking about possibly re-architecting the way they work. For this reason, bundles will not be supported by the initial version of this API.

cc @alanabweinstein @mattyza @haszari

Was this page helpful?
0 / 5 - 0 ratings