Within the foreach category_listing:products array on my CTGY template I have a few product custom fields I would like to display. Having trouble. And I think I could score a B- if you gave me a quiz on the new custom fields function, as I've used it quite successfully in numerous templates so far but I am at a total loss here.
I can insert this following code (within foreach category_listing:products) and generate a nice list of custom product field codes and names. Works as expected.
I do that just to test if I've not made any typos, and to get the correct custom field code. Works fine. But what I'm trying to accomplish is post the value of a particular custom field. Since I know the Read function is sound, I make some changes and do this:
Sadly, that "shipping" custom field value will not display. Or that variable doesn't exist. Or whatever. Same goes for several other fields I tried. There is indeed data filled in to the field for the products in the array. That data will even display if I add field:value to the test array in my first code snippet above. But, of course, that populates the page will all the custom field values for all the products -- but nevertheless it is there!
Surely I've done something wrong, but I can't figure it out. Can you help?
Thanks
I can insert this following code (within foreach category_listing:products) and generate a nice list of custom product field codes and names. Works as expected.
Code:
<mvt:item name="customfields" param="Read_Product_Code( l.settings:product:code, '', l.settings:custompfields )" /> <mvt:foreach iterator="field" array="custompfields"> &mvte:field:code;<br/> &mvte:field:name;<br/> </mvt:foreach>
Code:
<mvt:item name="customfields" param="Read_Product_Code( l.settings:product:code, 'shipping', l.settings:custompfields )" /> &mvt:custompfields:shipping;
Surely I've done something wrong, but I can't figure it out. Can you help?
Thanks
Comment