• Resolved songbirdwebdev

    (@songbirdwebdev)


    Thanks for the very useful plugin.
    I have a question about how to add WC products which have AWS calculators assigned to them to the cart. I have a form which will allow customers to add several items to the cart at once. So I will need to add the selected products (having aws calculators attached to them) to the cart when the form is processed.
    I’ve already tried using the WC cart function add_to_cart but this does not seem to work for products which have aws calculators.
    Any help or an example of how to do this would be very, very much appreciated!

    Thanks,
    Carmen

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Altos

    (@sefin)

    Hi,

    A new release of WPC will be released on September, version 2.3.0.

    In the meanwhile I can send you a bugfix version which solve your problem:

    https://altoswebsolutions.com/beta_wp_repository/2.2.28/woo-price-calculator.zip

    With this version you can add WPC products using Ajax:

    WooPriceCalculator.ajaxAddCartItem(productId, calculatorId, quantity, data);

    Data is equal to:

    var data = WooPriceCalculator.getFormDataInProductPage(".wpc-product-form");

    Thread Starter songbirdwebdev

    (@songbirdwebdev)

    Thank you very much. That works. I am using something like

    WooPriceCalculator.ajaxAddCartItem(51, 2, 3, ‘aws_price_calc_2=2’);

    and I am able to watch for the return w/

    $(document).on(‘awspcAjaxAddCartItemSuccess’, function(e, result) {
    console.log(‘awspcAjaxAddCartItemSuccess’);
    console.log(result);
    });

    Plugin Author Altos

    (@sefin)

    you are welcome!
    Great to know you solved your problem!
    ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding products that have AWS Price Calculators to cart programmatically’ is closed to new replies.