Create custom add to cart button in Woocommerce + custom values

Currently I'm fetching some content from another site and extracting it's price + name so I can add that product.

I'm using woocommercer right now and I was wondering whether there is a method or possibility where,

1. Rather than creating a product in the WP admin and then adding it to cart.

2. I extract the price + name of the product from DOM, save it in a variable and then when add to cart is clicked, saved as a product in WP admin.

Like the reverse of step 1. I'm assuming I need to create my own add to cart button with customized values.

Any ideas or suggestions are greatly appreciated.

Thanks!

  • aristath
    • Recruit

    Hello there @jc.yin, I hope you're well today!

    Create custom add to cart button in Woocommerce + custom values

    I'm afraid that I have never used WooCommerce.
    Have you tried posting this question on the support forum at woothemes? It's their plugin, so if anyone can help you it's them.

    Cheers,
    Ari.

  • jc.yin
    • Flash Drive

    Hi Hi,

    Thanks for the reply, I watched the video and also read the tutorial but I still think this isnt what, I'm trying to do. The contents that I'm fetching aren't from an affiliate site nor do they have any such programs. I want to do the reverse.

    Instead of manually creating a product in woocommerce and then adding it to cart.

    I want woocommerce to automatically create a product for me based on information pulled via the external content locates on my site.

    Can you think of any other methods this might work?

    Thanks

  • jc.yin
    • Flash Drive

    Hi,

    Thanks for the reply, I watched the video and also read the tutorial but I still think this isnt what, I'm trying to do. The contents that I'm fetching aren't from an affiliate site nor do they have any such programs. I want to do the reverse.

    Instead of manually creating a product in woocommerce and then adding it to cart.

    I want woocommerce to automatically create a product for me based on information pulled via the external content locates on my site.

    Can you think of any other methods this might work?

    Thanks

  • Imperative Ideas
    • HummingBird

    So you want something to programaticaly create products on the fly based on someone else's site? You could feasibly do this with an XML feed but it wouldn't actually incorporate with your shopping cart.

    Ari is right, this request is way, way outside of what WPMUdev is going to provide efficient help with. I'm going to point you to a pair of locations where the experts live.

    1. WooCommerce on GitHub (Here there be the authors of Woo)
    2. The WordPress channel on StackExchange (more advanced topics)

    I'll give you a parting gift here by mentioning that you're talking about writing a WooCommerce extension and the going cost is going to start at around $5000. Automation may be sexy but it isn't cheap and it is almost never generic.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.