woocommerce offtopic - Integration widget Mondial Relay Js

admin2025-01-07  3

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=""></script>  

 <!--On charge le widget mondial relay depuis leurs serveurs-->  
<script type="text/javascript" src=".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  
        });  
}); 

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  
        });  
}); 
Share Improve this question edited May 22, 2018 at 9:43 Johansson 15.4k11 gold badges43 silver badges79 bronze badges asked May 22, 2018 at 8:55 mimmilie83mimmilie83 1 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 Commented 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 Commented May 22, 2018 at 11:59
Add a comment  | 

1 Answer 1

Reset to default 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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736264934a1005.html

最新回复(0)