• Hello,

    I am building a WooCommerce theme with timber and your plugin, like those pizza delivery websites, where there is no classic product archive and single pages and all products are displayed underneath each other on one single shop page.

    This led me to the problem, that the first listed product always had the product options block, that the last listed product with option blocks has assigned.
    I did some research and found out it is happening because the ‘yith-wapo-reload-addons’ trigger function in front.js is building its serialized Addons data block with
    var addons = jQuery('form.cart').serializeArray();
    which results in getting ALL form.cart instances and then using the last ones data for the AJAX request.

    I changed this to
    var addons = jQuery(this).serializeArray();
    so that the function always uses the input fields found inside the current cart.

    So far I have not found any problems with this solution for my problem.
    Maybe this helps somebody who is doing the same as I am doing or the plugin devs can put it into the next update, if it is not causing any problems with other setups.

    HTH

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter scorpnetwork

    (@scorpnetwork)

    Update:
    My solution does not work as expected after further testing.
    It seems almost all functions in front.js have to be rewritten, so that the reload trigger functions work with multiple form.cart instances on a single page.

    Plugin Support Iván Sosa

    (@ivansosa)

    Hello there,

    Hope you are doing well! ??

    I’m sorry but the plugin is mainly developed for single product pages.
    This could be the reason why you have some difficulties making it work on a single shop page.

    I’m sorry, but unfortunately, we don’t support this type of customizations.

    We remain at your disposal.

    Have a great day!

    Thread Starter scorpnetwork

    (@scorpnetwork)

    Hello!

    No problem!. ??

    I changed the JS code like mentioned for all related functions. It should make no problem with regular usage on single pages, but adds the functionality to work with multiple instances on one page. You can use it freely in a future update if you like to.

    https://pastebin.com/EVPhNuiL

    Great plugin, thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Using multiple instances on one page (like pizza delivery websites)’ is closed to new replies.