How to get a "product picker" for a custom SKU field

Keith Donnell asked on November 6, 2015 18:35

I have added a custom field to the SKU class, and I would like the interface to display a drop-down list of all of the products/skus within the site.

I have tried setting the following properties on the field, but I only get one result (even though AllChildren on the specified node shows the results I desire within the macro selector popup), and it just shows the default .ToString() implementation of the node instead of the DocumentName:

Data Source:  Macro Expression:  Documents["/Alias"].AllChildren
Text Format:  {% DocumentName %}
Value Format:  {% NodeSKUID %}

How can I get this drop-down list to populate correctly?

Also, is there another way to get all products from a macro without having to specify a node? I tried setting the data source to CMS.Ecommerce.SKUInfoProvider.GetSKUs(CurrentSite.SiteID), but macros seem to be limited to a specific set of commands/properties.

Correct Answer

Joshua Adams answered on November 6, 2015 20:04

You could try using a uniselector and setting the object type to products or cms.product i believe. Another option would be a dropdown list and writing a query to take the products from the product table.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Keith Donnell answered on November 6, 2015 20:15

Thank you for the hint on using the uni selector. MUCH easier to configure than trying to figure out the correct macro to use. P.S. The object type I needed to use was ecommerce.sku

0 votesVote for this answer Mark as a Correct answer

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