Product SKUID in URL pattern

James Mosquito asked on November 3, 2020 11:49

Hi, is it possible to add the SKU of a product into the url pattern of it's page? And/or can you use field values from the page type?

Thanks, James

Correct Answer

David te Kloese answered on November 4, 2020 12:50

What is the Value from the SKU Field? There are almost 50 fields stored in the SKU..

You can just add the field name as a macro:

/{%DocumentCulture%}/Product/{%NodeGUID%}/{%NodeAlias%}?id={%SKUID%}&otherprops={%SKUNAME%}-{%SKUPrice%}-{%SKUNumber%}-{%SKUDescription%}

results in:

en-US/Product/8263f6cc-79b7-40ac-8042-92eb8580cef6/test?id=130&otherprops=test-12.340000000-abc456-desc

0 votesVote for this answer Unmark Correct answer

Recent Answers


David te Kloese answered on November 4, 2020 11:54

Hi,

Yes, as long as you configure your routing to accept it! Just add the following macro in the URL pattern field: {%SKUID%}

Quick example:

SKUID in url pattern

1 votesVote for this answer Mark as a Correct answer

James Mosquito answered on November 4, 2020 12:38

Hi David,

In this case I would like to use the value from the SKU field of a product and not the SKUID that is assigned by Kentico when creating the product. Is that possible?

Thanks, James

0 votesVote for this answer Mark as a Correct answer

James Mosquito answered on November 4, 2020 13:07

Brilliant thank you David. SKUNumber was the field value I was looking to use.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.