Okay
  Public Ticket #3084012
Abiiity to make AJAX calls
Closed

Comments

  •  2
    Dimitris Vayenas started the conversation

    We would like to use wpdatatables in more "mainstream" eshops that are used mainly in B2B contexts. So wpdatatables usability is great when reading procuct/catalogue listings.

    We would like to integrate, "add to cart" and "add to wishlist" functionality. We tried to do this issuing links like: 

    https://carro.gr/?add-to-cart=49774

    In the master-details page. The problem with this is that it redirects you to the homepage of the eshop and you have to start again with filtering etc. We would like to be able to do this using ajax calls etc. But adding ajax commands/scripts in each and every (of 130k) product  in our table is excessive and cumbersome.

    Is it please possible to provide a way to facilitate "form/ajax" submissions? 

  •  2
    Dimitris Vayenas replied

    Here is what actually is needed to be able to do to support for example the wishlist in one of my favourite themes (Botiga) (as told by their support team): 

    Firsly, the "heart" icon, that's the wishlist button on product cards is redenred through the function "botiga_wishlist_button" on Botiga free theme files: 'inc\plugins\woocommerce\features\wishlist.php'
    The "Add to wishlist" link you see on single product pages is redered by the function "botiga_single_wishlist_button" in the same file above (inc\plugins\woocommerce\features\wishlist.php).
    So my suggestion for you is check with the "Fast finder feature" plugin authors some way to inject your custom code inside each product table row. 

    Then, you can use some of the functions above to render the HTML from wishlist buttons. You need to make sure the "data-product-id" is passing the correct product id on the row.

    Once you have the HTML being rendered, you need to initialize it with JS code. I see that the "fast finder feature" does some AJAX requests to render the products based on the filter select. 

    Then you'll need to check with the plugin authors what's the JS event you might use to trigger our wishlist JS code. You'll need to run a code something like below:

    jQuery( '.fast-feture-plugin-selector' ).on( 'plugin-event-thats-triggered-after-all-products-are-rendered-on-table', function(){
        // Initialize wishlist    botiga.wishList.init();
    } );


  •  1,851
    Miloš replied


    Hi, Dimitris smile.png

    Firstly, I would like to sincerely apologize for the delayed response all around as we have been experiencing an unusually high number of tickets. 

    I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.

    -

    We will need the developer's assistance for this query as well, as this is also above my level of expertise on the matter.

    As soon as they give us their input on all the queries, we will report back for you.

    Thank you once again for your patience and cooperation.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  1,851
    Miloš replied

    Hi, Dimitris

    I was advised by the devs on this.

    Unfortunately, everything described here falls under custom work,

    and as our developers are very busy at the moment, working on some priority tasks and fixing bugs and issues with our plugins, they won't be having the time for custom work in the near future.

    If you need to hire someone for assistance, we can only recommend reaching out to someone who does custom solutions, such as WP Kraken, but we don't know their pricing.

    Of course, you could also try to devise a solution yourself.

    Our front-end is based on datatable JQuery plugin, and you can use its events, if you wish to try - more details here https://datatables.net/manual/events

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables