Resolvedgoogle.maps.places.Autocomplete

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #34057
    likewebcl
    Participant

    Hello, I need to edit the call of the Google Maps autocomplete api, the queries are very high since queries by letters are organically configured and I need to configure queries by user, as indicated here in the Google Maps Platform documentation:

    https://developers.google.com/maps/documentation/javascript/places-autocomplete#session_tokens

    Could you tell me or help me where to edit or add these code within the theme

    #34058
    likewebcl
    Participant

    Or do you recommend using a plugin like? : https://wordpress.org/plugins/scripts-n-styles

    #34061
    Althemist
    Keymaster

    Hi likewebcl,

    I’ll ask our lead developer Alex to step in and give you information what and where can be done.

    #34063
    Alex
    Keymaster

    Hi likewebcl,

    For the autocompletion we are using the Autocomplete widget with limiting the result to only required fields. The documentation says that when using the widget, it handles the sessions automatically in the background. So the costs are optimized as much as possible.

    Look at the first tip in from the link you sent:

    Tip: If your app is using the Autocomplete Widget you don’t need to implement sessions, as the widget handles sessions automatically in the background.

    Regards,
    Alex

    #34066
    likewebcl
    Participant

    Thank you Alex for your answer, we are in test mode and only with these queries the number of requests is very high, next week the trial starts and we will closely monitor the number of queries that are shown…


    @Alex
    , taking advantage of your intervention we have two points that we need to solve and hopefully you can help us:

    1.- Alex, within the development we also need that the address options appear for a specific country/city and not the whole world, in the api maps documentation at this link: https://developers.google.com/maps/documentation/javascript/places-autocomplete#constraining-autocomplete informs about that and how to configure it, in the topic where I can edit this code

    2.- we installed a delivery plugin: https://wordpress.org/plugins/local-delivery-drivers-for-woocommerce (pro), but it has a compatibility problem (found), I explain: when products are added to the cart, these they disappear after a few minutes or simply go to checkout, I contacted support for this plugin and after testing they sent this message:

    This is the error and I think it comes from the lafka plugin or theme,
    please send it to their support for a fix.

    get_cart was called incorrectly, Get cart should not be called before the wp_loaded action

    [15-Jun-2022 04:14:01 UTC] get_cart was called incorrectly. Adquirir carrito no debería ser llamado antes de la acción wp_loaded Backtrace: require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook->apply_filters, WooCommerce->init, do_action(‘woocommerce_init’), WP_Hook->do_action, WP_Hook->apply_filters, LDDFW_Admin->lddfw_shipping_settings__premium_only, WooCommerce->__get, WooCommerce->shipping, WC_Shipping::instance, WC_Shipping->__construct, WC_Shipping->init, do_action(‘woocommerce_shipping_init’), WP_Hook->do_action, WP_Hook->apply_filters, Lafka_Shipping_Areas::clear_wc_shipping_rates_cache, WC_Cart->get_shipping_packages, WC_Cart->get_items_needing_shipping, WC_Cart->get_cart, wc_doing_it_wrong. This message was added in version 2.3.

    Thank you very much Alex and excellent work with the lafka theme!!

    #34075
    likewebcl
    Participant

    Hi again

    Another detail that is important and we have found, when we are on the checkout page, finishing the order, in the address item it is possible to edit/change the address and the previously registered address in the pop-up window is updated by this new address… the problem is that this new address is not within the shipping area, in the same way the payment can be made, the correct thing is that these orders should not be accepted (the validation is not encoded as in the pop-up window).

    The other option and it would be better: the address field in the checkout is blocked and another address cannot be entered, only the one registered in the pop-up window can be used..

    I hope you feel that the idea is to optimize and enhance the work you have done with this theme, since solving these details and as I have mentioned before will be one of the best themes… thank you very much

    #34101
    Alex
    Keymaster

    Hi likewebcl,

    Please allow us couple of more days to look up / investigate the issues.

    Regards,
    Alex

    #34107
    likewebcl
    Participant

    OK thank you very much

    #34136
    Alex
    Keymaster

    Hi likewebcl,

    We went through your questions. Here is our thoughts:
    1. We don’t provide an option to set boundaries for the Autocomplete widget, neither there is a hook or something to inject a code. The only way I can think of is to edit the js file manually and keep track of it after each update of the theme and plugin. The file you need to edit is: lafka-branch-locations-front.min.js You can edit the minified version, search for “google.maps.places.Autocomplete” and just add the boundaries options according to the documentation.
    We know it is not the perfect solution, but there is no a better way currently. We will discuss with the team and may add it as an option in future updates.

    2. We’ve went through the code and we can’t find a place where we are calling get_cart before wp_loaded. Could you please check if the issue appear with the lafka-plugin disabled or with another theme or both. If it appears only with Lafka, then we will need a copy of the plugin you are using, as it is a pro version.

    3. About the issue you describe for the user address validation in the checkout page. Actually all checks that are done in the popup are executed also on the checkout page if the user changes the address. So shipping should also be affected. Can you send us an url to the site. And temporary admin credentials, so we can check.

    Regards,
    Alex

    #34143
    likewebcl
    Participant
    This reply has been marked as private.
    #34206
    Alex
    Keymaster

    Hi likewebcl,

    Thank you for the details. Please allow few more days to investigate.

    Regards,
    Alex

    #34209
    likewebcl
    Participant

    thank you very much @alex, we are attentive to what you communicate

    #34228
    Alex
    Keymaster
    This reply has been marked as private.
    #34229
    Alex
    Keymaster

    Hi likewebcl,

    I think I understand what do you mean about the checkout page and the address. I couldn’t check all your settings as the account you give me doesn’t have the admin privileges.

    But here is how we’ve designed this:
    1. You are drawing the areas where all your stores will deliver and name them accordingly.
    2. Create shipping methods for each area and select them to be limited by this area. (This way the clients will not be allowed to order outside the area when they change the address at checkout)
    3. Create branches for each area.

    We don’t think it is good idea to limit the clients to change their addresses on checkout, as this is a common functionality.

    Hope you see my point.
    Regards,
    Alex

    #34230
    Alex
    Keymaster

    Hi likewebcl,

    Regarding the issue with the plugin “Local Delivery Drivers for WooCommerce” , we’ve tested on our site with the free version and there were no issues.
    Could you please give us the exact steps on how to reproduce the issue? Also what are the exact settings in the plugin.
    I couldn’t download it from the link you’ve sent.

    Regards,
    Alex

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register