0

Could you help me please: I have to integrate the code of Mondial Relay but I do not know where I have to integrate it. Thanks a lot

The code is :

<!--On charge Google Map API-->  
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>  

 <!--On charge le widget mondial relay depuis leurs serveurs-->  
<script type="text/javascript" src="https://widget.mondialrelay.com/parcelshop-picker/v3_0/scripts/jquery.plugin.mondialrelay.parcelshoppicker.min.js"></script>  

$(document).ready(function () {  
       // Charge le widget dans la DIV d'id "Zone_Widget" avec les paramètres indiqués  
       // et renverra le Point Relais sélectionné par l'utilisateur dans le champs d'ID "Retour_Widget"  
        $("#Zone_Widget").MR_ParcelShopPicker({     
                Target: "#Retour_Widget", // Selecteur JQuery de l'élément dans lequel sera renvoyé l'ID du Point Relais sélectionné (généralement un champ input hidden)  
                Brand: "BDTEST  ", // Votre code client Mondial Relay  
                Country: "FR" // Code ISO 2 lettres du pays utilisé pour la recherche  
        });  
}); 
2
  • stackoverflow.com/help/how-to-ask Please explain what are you trying to archive, where you want to add this code on specific header etc
    – jas
    May 22, 2018 at 9:29
  • I do not know where I have to put the code sent to me by Mondial Relay. is it on the cart.php page ? Mondial relay Mondial Relay makes it possible to offer shops so that customers can pick up their parcels.
    – mimmilie83
    May 22, 2018 at 11:59

1 Answer 1

0

You need to add this quick and dirty code in your functions.php if you're trying to add mondial relay to checkout page :

add_action('wp_footer', function(){
    if(is_checkout())
    {
    ?>      
    <!--On charge Google Map API-->  
    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>  

    <!--On charge le widget mondial relay depuis leurs serveurs-->  
    <script type="text/javascript" src="https://widget.mondialrelay.com/parcelshop-picker/v3_0/scripts/jquery.plugin.mondialrelay.parcelshoppicker.min.js"></script>  
    <script>
    $(document).ready(function () {  
        // Charge le widget dans la DIV d'id "Zone_Widget" avec les paramètres indiqués  
        // et renverra le Point Relais sélectionné par l'utilisateur dans le champs d'ID "Retour_Widget"  
        $("#Zone_Widget").MR_ParcelShopPicker({     
                Target: "#Retour_Widget", // Selecteur JQuery de l'élément dans lequel sera renvoyé l'ID du Point Relais sélectionné (généralement un champ input hidden)  
                Brand: "BDTEST  ", // Votre code client Mondial Relay  
                Country: "FR" // Code ISO 2 lettres du pays utilisé pour la recherche  
        });  
    }); 
    </script>
    <?php
    }
});

You better have to use the mondial relay plugin I think : https://www.mondialrelay-woocommerce.com/

Be sure to have a tag with "Zone_Widget" and "Retour_Widget" id in your checkout page.

1
  • Thanks a lot but I contacted mondial relay, they told me that there was no plugin that existed. it is under development. I have not a tag with zone_widget. It's the file cart.php which have the tag ? thanks you very much for your help
    – mimmilie83
    May 22, 2018 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.