Developer forum

Forum » Feature requests » GLS ShopDelivery

GLS ShopDelivery

Jacob Johnsen Dynamicweb Employee
Jacob Johnsen
Reply

Hi,

It would be nice with a map showing the places were you can pick-up your parcels in the GLS ShopDelivery integration.

Best regards

Jacob

GLS_-_pakkeshop.png

Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Jacob

Yes, that would be a great feature in the Rapido implementation.

(This can be done already using Google maps in the cart template).

BR Nicolai

Votes for this answer: 1
 
Nicolai Pedersen
Reply

See attachment for what have been specified for Rapido.

AttachFileHandlerTB21NL6N.png
 
Ivan Marijanović
Ivan Marijanović
Reply

Hi Nicolai

any instructions how to get this working (like in picture in your post).

Sincerely

Ivan

 
Nicolai Pedersen
Reply

Hi Ivan

There is a simple loop of the data you can find here:

https://doc.dynamicweb.com/template-tags/ecommerce/shipping-providers/gls

Attached find the template we use in Rapido.

I am aware that these are not complete steps, but it gives you pointers at least.

Basically you get a list of potential parcels shops from the ParcelShops loop in the template and then we just render for selection using some maps implementation. We use Google maps, could be open maps, bing maps or something else.

BR Nicolai

 
Ivan Marijanović
Ivan Marijanović
Reply

Thanx Nicolai

I saw the shiiping block but my question is more oriented togetting this parcels loops. I have defined the Users in DW  and put them in group distributors. So how can I use this group as a source for ParcelShoops loop.

This is probably basic question but I did not work with custom data sources (probalbly jsonFeeds) so far.

Thanks in advance.

Ivan

 
Nicolai Pedersen
Reply

Hi Ivan

The ParcelShops loop is a feature of a shippingProvider that is connected to an external shipping system like GLS, UPS or other shipping services. The parcel shops are then returned from that service and looped in Dynamicweb.

What you want is a list of "users" in a group and use those as a pickup store, and to do that you have to use the Dynamicweb.Security API to load a group "Distributors" and then loop the users. An alternative if you want the json feed of this, is to create a page as a feed with ther user management app and create a template that returns json. Rapido does something similar in its "feeds" node in the content tree.

You can also see a similar guide on how to do that for products in XML here: https://doc.dynamicweb.com/documentation-9/how-tos/general/setting-up-a-google-merchant-product-feed
You just need to not send XML but JSON and not use Ecommerce app, but user management app.

BR Nicolai

 
Ivan Marijanović
Ivan Marijanović
Reply

Thanx.

This is the way I tried.

For start I hardcoded data in this:

public class ShopData
    {
        public string Number {get; set;}
        public string CompanyName { get; set;}
        public string Streetname { get; set;}
        public string Streetname2 { get; set;}
        public string ZipCode { get; set;}
        public string CityName { get; set;}
        public string Telephone { get; set;}
        public string Longitude { get; set;}
        public string Latitude { get; set;}

        public static List<ShopData> GetShops()
        {
            List<ShopData> Shops = new List<ShopData>
                {   new ShopData { Number = "1", CompanyName = "Test", Streetname = "Adresa 1", CityName = "Grad 1" },
                    new ShopData { Number = "2", CompanyName = "Test 2", Streetname = "Adresa 2", CityName = "Grad 2" }
                };
            return Shops;
        }        
    }

 

and then in RenderFrontend tried this:

var parcelShops = ShopData.GetShops();
                        if (parcelShops != null)
                        {
                            object numberObj;
                            order.ShippingProviderValues.TryGetValue("ParcelShopNumber", out numberObj);
                            var number = (string)numberObj;

                            foreach (var shop in parcelShops)
                            {
                                itemTemplate.SetTag("FieldPrefix", FieldPrefix);
                                itemTemplate.SetTag("IsSelected", shop.Number.Equals(number, StringComparison.OrdinalIgnoreCase));

                                itemTemplate.SetTag("Number", shop.Number.Trim());
                                itemTemplate.SetTag("CompanyName", shop.CompanyName.Trim());
                                itemTemplate.SetTag("Streetname", shop.Streetname.Trim());
                                itemTemplate.SetTag("Streetname2", shop.Streetname2.Trim());
                                itemTemplate.SetTag("ZipCode", shop.ZipCode.Trim());
                                itemTemplate.SetTag("CityName", shop.CityName.Trim());                               
                                itemTemplate.SetTag("Telephone", shop.Telephone.Trim());
                                itemTemplate.SetTag("Longitude", shop.Longitude.Trim());
                                itemTemplate.SetTag("Latitude", shop.Latitude.Trim());

                                itemTemplate.CommitLoop();
                            }
                        }

 

 

But could not get it to work!

Thank you for your effor!

Ivan

 
Nicolai Pedersen
Reply

What do you mean when you say "Could not get it to work"? Will the map not load, or is the data not rendered, or no markers in the map, js errors? What?

And in which template do you add this code?

I do not understand...

 
Ivan Marijanović
Ivan Marijanović
Reply

The map is never displayed. I use GLS.cs template from ShippingProvider!

Ivan

 
Ivan Marijanović
Ivan Marijanović
Reply

Interetsing

even when I set gls I dont get map.

 

Example1.jpg
 
Ivan Marijanović
Ivan Marijanović
Reply

Hi Nicolai

I need to finish this task today. Is there a way we can chat about this?

Ivan

 
Nicolai Pedersen
Reply

You are always welcome to contact the support.

Did you configure your Shipping and GLS as specified in the manual?:

https://doc.dynamicweb.com/documentation-9/ecommerce/payment-shipping/shipping and https://doc.dynamicweb.com/documentation-9/how-tos/shipping-providers/gls-shopdelivery

You can see the feature in action on the Rapido demo:

http://rapidodemo.dynamicweb-cms.com/

Add a product to the cart and go to checkout, specify and address and select GLS as shipping. See dump.

Capture.PNG