Developer forum

Forum » Development » Generating eCom links from product information

Generating eCom links from product information

Martin Slot
Reply
Hello there

I am in the process of rewriting some code for a customer. They want to have some extra functionality added to a cutsom search engine that another team member has written.

To make long story short, is there any built-in functionality in DW, that takes fx the group id, and product id and the builds a link to that product?

I am not the strongest eCom'er. I hope to be one day, but I still have a long way.


Replies

 
Nicolai Høeg Pedersen
Reply
Build a link how - as in search friendly, or the link to the product?

In the products loop in the grouplist, you have template tags containing the detail link:
ie: or - the latter containing the product ID and Group ID
http://templates.dynamicweb-cms.com/eCommerce/Dynamicweb-eCommerce-template-tags/Product-Catalog/Product-list/Loops/Products.aspx

If you are talking about SEO urls, see management center, Web and HTTP, searchfriendly URLs. See attached dump.

Capture.JPG
 
Martin Slot
Reply
I want to build a link to a certain product. Not in the form: http://www.producent.de/Default.aspx?id=15904&productID=PROD2007, but more like http://www.producent.de/Power_-_Control_Technology/Diesel_Control_Technology/Products/Plant_management.aspx?ProductID=PROD2007. Fx The product with the ID, PROD2007 is represented in 4 groups, that have different URLs. Is it possible for me to generate the pretty url from the groupID and productID, in some way?
 
Nicolai Høeg Pedersen
Reply
In the product list use the tag @Ecom:Product.LinkGroup.Clean and enable the search friendly url as mentioned in my previous post.

Then you get URLs like /Products/GroupName.aspx, /Products/GroupName/ProductName.aspx and /Products/GroupName/ProductName/VariantName.aspx

If the product is located in several groups, it has several URLs - a problem, I know. A feature is coming up to fix that.

 
Martin Slot
Reply
Okay. So there is not a standard way of doing this. Anyway. I am doing all this programmatically, so I can not even use the @Ecom tags. Is there a way for me to construct them by myself?
 
Nicolai Høeg Pedersen
Reply
It is a standard way...

If you generate a link like Default.aspx?ID=123&GroupID=GROUP1&ProductID=PROD123 and output that to the system, Dynamicweb will automatically change that url to the search friendly version before delivering the HTML to the browser - if it is enabled of course.

 
Martin Slot
Reply
Strange. I have enabled that, and it still does not work :( But you mentioned that it would not work if the product was in 2 or more groups. Maybe that is why.
 
Nicolai Høeg Pedersen
Reply
A product can be in 2 groups - giving it 2 urls. It works, but there is the possible Duplicate Content issue...

If it does not work, something else is wrong.

Can you post a URL?

 
Martin Slot
Reply
Hello

Here is the URL: http://www.deif.com/Default.aspx?id=15904&productID=PROD2070&groupID=GROUP883 but what they really want is this: http://www.deif.com/Power_-_Control_Technology/Diesel_Control_Technology/Products/AMF.aspx?ProductID=PROD2070. This URL clearly shows the structure of the eCom.

 
Nicolai Høeg Pedersen
Reply
Hi Martin...

Yes - then enable it in management center. Attached a screendump of the settings on deif.com - simply set the 2 checkboxes as statet above in the other screendump.

Capture.JPG
 
Martin Slot
Reply
Strange. These two settings is set in our backend.
ecomUrlSettings.jpg
 
Nicolai Høeg Pedersen
Reply
You have NOT set the settings. Please read the text in the screendumps.

See my new attachments. Now with the settings highlighted that should be set, which they are not.

Capture.JPG
 
Martin Slot
Reply
Oooh. Sorry. I looked at the wrong screenshot: http://developer.dynamicweb-cms.com/Files/Filer/Forum/Upload/Thread27094/Message27115/Capture.JPG and not http://developer.dynamicweb-cms.com/Files/Filer/Forum/Upload/Thread27094/Message27096/Capture.JPG. I will try to turn them on.
 
Martin Slot
Reply
I know that you are a Dynamicweb guru. I am not. I can not get hold of our Dynamicweb guy at the company, but I am eager to test this. Do you know if this breaks anything eg. is the this change invertible?
 
Nicolai Høeg Pedersen
Reply
It is not invertible - and it will not break things. Just turn it on and test.
 
Nicolai Høeg Pedersen
Reply
If it does not work as you want, just turn it off again...
 
Martin Slot
Reply
I have updated the settings, but when I try to visit this link, it does not show the pretty url: http://www.deif.com/Default.aspx?id=15904&ProductID=PROD1400&GroupID=GROUP907. Could it be that deif.com has a complicated setup (I am a backender at my firm so I do not know what setup our frontenders have picked), but could a certain setup smash this?
 
Martin Slot
Reply
See attached. Could it maybe be because of my url type settings?
urlSettingsDeif.jpg
 
Nicolai Høeg Pedersen
Reply
Call service desk and have them help you...

 

You must be logged in to post in the forum