• Resolved Jay

    (@aaronholt)


    Hi,

    I’m currently working on a website for a client, and their product catalogue is supplied by a third party website, via an iframe. I’m well aware of the downsides of doing things this way, however with a constantly changing catalogue of over 22000 products, maintaining the catalogue themselves would be impossible as a small business.

    It’s all working fine, having added the products to the WooCommerce database, however I’m at a loss as to how I can reference products via the add-to-cart url. Each of the products has a unique SKU, which is the database field I’d like to add to the cart with, however WooCommerce seems to be enforcing that I can only add products to the cart using the id, which the third party catalogue obviously can’t provide.

    Is there a way around this?

    Kind regards,
    Aaron

    https://www.ads-software.com/plugins/woocommerce/

Viewing 8 replies - 16 through 23 (of 23 total)
  • Thread Starter Jay

    (@aaronholt)

    OK, thanks for all your help. I’ve created plugins for WordPress before, and I’m plenty competent with PHP, just a little unsure as to how to create the capture url / SKU function within WordPress. Say I pass a custom add-to-cart url with the SKU, how do I get WordPress to recognise that url, and then pull the necessary record from the database?

    Thanks

    Thread Starter Jay

    (@aaronholt)

    I’ve no issue doing this via PHP / MySQL, just unsure of how to do it ‘correctly’ within WordPress / WooCommerce

    Plugin Contributor Mike Jolley

    (@mikejolley)

    You’d hook into something like ‘init’ (a general WordPress action) and look for the GET/POST data.

    Thread Starter Jay

    (@aaronholt)

    Thanks, I can see how that would work. Is there anything out there which can help me achieve this via a custom url?

    Thanks again

    Plugin Contributor Mike Jolley

    (@mikejolley)

    You can use just querystring I assume.

    Thread Starter Jay

    (@aaronholt)

    will I need to use an add_query_vars_filter?

    Plugin Contributor Mike Jolley

    (@mikejolley)

    No – just use native PHP.

    Hi ! I’m trying to develop something similar , your case sound similar to mine , i ‘ m working with arinet partstream wich provide me more than 200.000 product references.

    Here is a technical document that explains how to integrate whith third party carts .

    I hope it can help

    arinet.com/PartStream/cartSetup.pdf

Viewing 8 replies - 16 through 23 (of 23 total)
  • The topic ‘Add-to-cart by url – add product by SKU’ is closed to new replies.