Forum Replies Created

Viewing 15 replies - 1 through 15 (of 48 total)
  • Thread Starter patchyart

    (@patchyart)

    Thank you for all your help!

    Last question lol

    Is there anyway to sort the tags section by product counts?

    Thanks!

    Thread Starter patchyart

    (@patchyart)

    Thank you!

    And how would we make sure this function only runs after the infinite scroll filtering ajax

    jQuery(document ).on( 'awf_ajax_filter', function() {
      jQuery( "<div id='loading-of-results' class='loading-result-msg'>Loading More Products <i class='fa fa-spinner fa-spin'></i></div>").insertAfter( a_w_f.products_wrappers.find( awf_data.products_container ) );
    });

    This works it just fire on any ajax filtering

    • This reply was modified 7 months, 3 weeks ago by patchyart.
    Thread Starter patchyart

    (@patchyart)

    Hi,

    We’ve found that after AJAX filtering the countdown timer for auctions is not reinitiliased (e.g. see here)

    Have you guys run into this before?

    Thanks

    Thread Starter patchyart

    (@patchyart)

    Hi,

    As we have the different filters on separate pages ‘browse-art’ and ‘local-art’ wouldn’t a simple:

    <script>
    if(window.location.pathname.includes('/browse-art/')){
       awf_data.ajax_mode = 'dedicated_ajax';
    }
    </script>
    
    

    do the trick?

    • This reply was modified 8 months ago by patchyart.
    • This reply was modified 8 months ago by patchyart.
    Thread Starter patchyart

    (@patchyart)

    Thank you for that!

    I added some checks to remove the message after clearing, or filtering for something else if anyone stumbles across this thread:

    
    jQuery( document ).on( 'awf_after_ajax_products_update', function( event, $response ) {
      if ( ( 'ajax_pagination_end_reached' in awf_data ) && awf_data.ajax_pagination_end_reached ) {
          const clearButtonNone =document.querySelector("div.awf-reset-btn-container.awf-bottom-reset-btn-container > button");
     const filterButtonNone = document.querySelector("div.awf-btn-container > button");
    
               clearButtonNone .addEventListener('click', ()=> removeMsg());
               filterButtonNone .addEventListener('click', ()=> removeMsg());
               
               function removeMsg(){
                  if(document.querySelector("#end-of-results")){
                      document.querySelector("#end-of-results").remove();
               };
               };
    
    
    if(!document.querySelector("#end-of-results")){
    jQuery( "<div id='end-of-results' class='end-result-msg'>No more products found.</div>").insertAfter( a_w_f.products_wrappers.find( awf_data.products_container ) );
    }
      }
    } );

    About the AJAX mode per filter preset, I meant more for example having dedicated AJAX on one preset and enhanced compatibility on another as our default browse page doesn’t need the enhanced compatibility but our geolocation one does

    Best,

    Leo

    Thread Starter patchyart

    (@patchyart)

    Also, is it possible to set the ajax filtering mode on a per filter basis? Or is it just the overall setting which is possible?

    Thanks

    Thread Starter patchyart

    (@patchyart)

    Thank you for your help!

    I’m working on preserving the location filter + product filters, though i think setting up a mouse over event listener on the geolocation submit button to check / store filter parameters and then reloading the page with them after button click should do the trick!

    Here is a way I figured to make sure any placeholder images are replaced after the ajax search:

    jQuery(document).on('awf_after_ajax_products_update', function () {
    
    //check if placeholder catalog images are present
    checkExists("a.woo_catalog_media_images > img[src*='data:image/svg']");
    
    //check if placeholder featured badges are present
    checkExists("div.wpcbm-badge > div > img[src*='data:image/svg']");
    
            function checkExists(query_string){
                let temp_nodes =document.querySelectorAll(query_string);
                if(temp_nodes){
                     temp_nodes.forEach(element => {element.src = element.getAttribute("data-src");
                    });
            }
            }
    });

    Regarding the map pins, I believe it is just that way by dokans design unfortunately, and I haven’t looked into how to just place all of them yet.

    Finally, we have switched to the load more product list style and were wondering if there is anyway to add a simple message at the bottom of the product list if that is the end of the products found?

    Best,

    Leo

    • This reply was modified 8 months ago by patchyart.
    Thread Starter patchyart

    (@patchyart)

    On https://patchy-art.co.uk/local/ if the geolocation filter is used after annasta filters are used, the filters are lost from the url

    For example if you search for on-sale products and then narrow it down to those located near Upton, West Yorkshire, England the active filters are lost from the url after geolocation. Though they can be added back to narrow the search afterwards.

    Is there anyway to ensure these filters arent lost after a geolocation search?

    Also it seems that if you go to the next page of results after using the geolocation the images are blank. For example if you search for products near York, England and then go to the second page

    Best,

    Leo

    • This reply was modified 8 months ago by patchyart.
    • This reply was modified 8 months ago by patchyart.
    • This reply was modified 8 months ago by patchyart.
    Thread Starter patchyart

    (@patchyart)

    Thank you for that!

    I copied the code from dokan-geolocation-locations-map-mapbox.js?ver=3.9.10

    to create this:

    
    jQuery(document).on('awf_after_ajax_products_update', function () {
      if ('undefined' !== typeof DokanGeo) {
        (()=>{
        var e;
        e = jQuery,
        DokanGeo.LocationsMaps = {
            map: null,
            mapboxId: "dokan-geolocation-locations-map",
            items: [],
            data: {
                type: "FeatureCollection",
                features: []
            },
            marker: {
                image: null,
                clusterer: null
            },
            modal: e(".dokan-geo-location-modals").iziModal({
                closeButton: !0,
                appendTo: "body",
                title: "",
                headerColor: dokan.modal_header_color
            }),
            init: function() {
                var o = this
                  , a = {
                    longitude: 0,
                    latitude: 0
                };
                if (mapboxgl.accessToken = DokanGeo.mapbox_access_token,
                o.map = new mapboxgl.Map({
                    container: o.mapboxId,
                    style: "mapbox://styles/mapbox/streets-v10",
                    center: [DokanGeo.default_geolocation.longitude, DokanGeo.default_geolocation.latitude],
                    zoom: DokanGeo.map_zoom
                }),
                o.map.addControl(new mapboxgl.NavigationControl),
                o.items = e('[name="dokan_geolocation[]"]'),
                o.items.each((function(t) {
                    e(this).val();
                    var n = e(this).data("latitude")
                      , i = e(this).data("longitude")
                      , r = {
                        type: "Feature",
                        properties: {
                            id: "dokan-geolocation-item-" + t,
                            info: e(this).data("info")
                        },
                        geometry: {
                            type: "Point",
                            coordinates: [i, n, 0]
                        }
                    };
                    o.data.features.push(r),
                    a.longitude += i,
                    a.latitude += n
                }
                )),
                a.longitude && a.latitude)
                    o.map.setCenter([a.longitude / o.items.length, a.latitude / o.items.length]);
                else {
                    const e = new URLSearchParams(window.location.search)
                      , a = Object.fromEntries(e.entries());
                    o.map.setCenter([a.longitude, a.latitude])
                }
                o.map.on("load", (function() {
                    o.loadImages("image", DokanGeo.marker.image),
                    o.loadImages("clusterer", DokanGeo.marker.clusterer)
                }
                ))
            },
            loadImages: function(e, o) {
                var a = this;
                a.map.loadImage(o, (function(o, t) {
                    o || (a.marker[e] = t,
                    a.map.addImage("dokan-marker-" + e, t),
                    a.addMapLayers())
                }
                ))
            },
            addMapLayers: function() {
                var e = this;
                e.marker.image && e.marker.clusterer && (e.map.addSource("dokan_geolocation_map_main_data", {
                    type: "geojson",
                    data: e.data,
                    cluster: !0,
                    clusterMaxZoom: 14,
                    clusterRadius: 50
                }),
                e.map.addLayer({
                    id: "clusters",
                    type: "symbol",
                    source: "dokan_geolocation_map_main_data",
                    filter: ["has", "point_count"],
                    layout: {
                        "icon-image": "dokan-marker-clusterer",
                        "icon-allow-overlap": !0,
                        "text-allow-overlap": !0
                    }
                }),
                e.map.addLayer({
                    id: "cluster-count",
                    type: "symbol",
                    source: "dokan_geolocation_map_main_data",
                    filter: ["has", "point_count"],
                    layout: {
                        "text-field": "{point_count_abbreviated}",
                        "text-font": ["DIN Offc Pro Medium", "Arial Unicode MS Bold"],
                        "text-size": 12
                    },
                    paint: {
                        "text-color": "rgb(253, 218, 206)"
                    }
                }),
                e.map.addLayer({
                    id: "unclustered-point",
                    type: "symbol",
                    source: "dokan_geolocation_map_main_data",
                    filter: ["!", ["has", "point_count"]],
                    layout: {
                        "icon-image": "dokan-marker-image",
                        "icon-allow-overlap": !0,
                        "text-allow-overlap": !0
                    }
                }),
                e.map.on("click", "clusters", (function(o) {
                    var a = e.map.queryRenderedFeatures(o.point, {
                        layers: ["clusters"]
                    })[0].properties.cluster_id;
                    e.map.getSource("dokan_geolocation_map_main_data").getClusterLeaves(a, 255, 0, (function(o, t) {
                        if (e.map.getZoom() > 9 && t.length > 1) {
                            var n = '<div class="white-popup dokan-geo-map-info-windows-in-popup">'
                              , i = 0;
                            for (i = 0; i < t.length; i++)
                                n += e.getInfoWindowContent(t[i].properties.info);
                            n += "</div>",
                            e.modal.iziModal("setContent", n.trim()),
                            e.modal.iziModal("open")
                        } else
                            e.map.getSource("dokan_geolocation_map_main_data").getClusterExpansionZoom(a, (function(o, a) {
                                o || e.map.easeTo({
                                    center: t[0].geometry.coordinates,
                                    zoom: a
                                })
                            }
                            ))
                    }
                    ))
                }
                )),
                e.map.on("mouseenter", "clusters", (function() {
                    e.map.getCanvas().style.cursor = "pointer"
                }
                )),
                e.map.on("mouseleave", "clusters", (function() {
                    e.map.getCanvas().style.cursor = ""
                }
                )),
                e.map.on("click", "unclustered-point", (function(o) {
                    var a = e.map.queryRenderedFeatures(o.point, {
                        layers: ["unclustered-point"]
                    })[0].properties.info;
                    a && (e.map.easeTo({
                        center: o.lngLat
                    }),
                    new mapboxgl.Popup({
                        closeOnClick: !0
                    }).setLngLat(o.lngLat).setHTML(e.getInfoWindowContent(a)).setMaxWidth("654px").addTo(e.map))
                }
                )))
            },
            getInfoWindowContent: function(e) {
                "string" == typeof e && (e = JSON.parse(e));
                var o, a = DokanGeo.info_window_template;
                for (o in e)
                    a = a.replace("{" + o + "}", e[o]);
                return a
            }
        },
        e("#dokan-geolocation-locations-map").length && DokanGeo.mapbox_access_token && DokanGeo.LocationsMaps.init()
    }
    )();
    
      }
    });

    and that worked for me, for if anyone else has this issue!

    Perhaps dokan will get back to me with a neater way to do this

    Best,

    Leo

    Thread Starter patchyart

    (@patchyart)

    Regarding the first point, just setting the ajax mode to enhanced compatibility fixed the issue! Its just the updating the pin location to reflect the filtered products

    Thread Starter patchyart

    (@patchyart)

    Hi, thank you!

    Something like this? :

    add_action('comment_post', 'lscwp_purge_product_update', 10, 3);
    function lscwp_purge_product_update( $comment_ID, $comment_approved, $commentdata ) {
        
      $comment_post_id = $commentdata['comment_post_ID'];
       if (defined('LSCWP_V')){
            do_action( 'litespeed_purge_post', $comment_post_id );
        }
    }
    Thread Starter patchyart

    (@patchyart)

    Hi, thank you that works perfectly! However, testing on chrome mobile shows that although the scroll adjustment works, nothing can be clicked after the next page of products loads. This is not the case on safari weirdly.

    Testing without the scroll adjustment script on chrome shows that this was a problem that was happening before without us noticing.

    Is this an issue you have come across before?

    Thank you for all your help,

    Leo

    Thread Starter patchyart

    (@patchyart)

    Even when turning off all plugins except woocommerce and annasta and changing to another theme, the /src folder is still created

    Thread Starter patchyart

    (@patchyart)

    Hi,

    Looking into the annasta plugin /code folder, there is no /src folder that exists on the backend. So something else is creating this folder and erroneously putting into the annasta filter folder?

    Thread Starter patchyart

    (@patchyart)

    Hi,

    I’ve been in contact with my hosting service and they are unsure where that would be coming from on their end. I have tried turning all other plugins off and changing themes but that /src file is still there.

    Any advice you have moving forward would be appreciated

    Thanks

Viewing 15 replies - 1 through 15 (of 48 total)