• Resolved aldesantos

    (@aldesantos)


    I have a page that contains both Contact Forms 7 form and a WooCommerce variable product (insurance product). The page first has a 3 step process in which the user will first select their property, then they choose their property limit, then liability limit. To eliminate the user entering in their product selection twice, the I am updating the product variation selections for the user using jQuery. However, having the selection values updated isn’t firing the add to cart code (for variations) so the add the cart button is showing up disabled (like the product selections weren’t made) and the price for the product selection is not showing. What is a simple script that fires the event to calculate the price and make the ‘Add to Cart’ button enabled?

Viewing 4 replies - 1 through 4 (of 4 total)
  • dougaitken

    (@dougaitken)

    Automattic Happiness Engineer

    Hey @aldesantos

    If I understand correctly, you’re looking to have the add-to-cart URL update dynamically with the “selected” variation based on this three-step process, is that correct?

    This is a bit beyond what I’m familiar with but someone else might be able to chime in here. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the following places for more development-oriented questions:

    1. WooCommerce Slack Community: https://woocommerce.com/community-slack/
    2. Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.woocommerce/

    Alternatively, you could look at hiring a developer who is knowledgeable in WooCommerce from the WooCommerce Customizations Page.

    Thanks,

    Thread Starter aldesantos

    (@aldesantos)

    @dougaitken Yes I am dynamically trying to select a product variation so that a user does not have to enter their product choice twice. The values are changing on the <select> tag correctly, but the Add to Cart button keeps the class “disabled” and “wc-variation-selection-needed”, which keeps a user from clicking it to continue to Checkout.

    dougaitken

    (@dougaitken)

    Automattic Happiness Engineer

    Hey @aldesantos

    Got it, thanks for confirming!
    As I mentioned, this is a fairly complex development topic so hopefully someone here can help out, otherwise, you can receive help via one of the options I mentioned before.

    Thanks,

    Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    Kind regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WooCommerce – Function for add variation to cart’ is closed to new replies.