VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: RobertL on May 13, 2016, 17:51:56 PM

Title: How to show customfields on horizon browse page?
Post by: RobertL on May 13, 2016, 17:51:56 PM
Hi,

VM 3.0.16/J3.5.1
I'm having a bit of trouble, site I'm building is being used as a catalog only, so without pricing and add to cart section. I do however need to show customfields. Sublayout used is products_horizon.
As far as config goes, showing customfields on category pages is enabled.

thanks,
Robert
Title: Re: How to show customfields on horizon browse page?
Post by: RobertL on May 13, 2016, 18:18:36 PM
I should mention that all customfields are simple strings, no cart variants.
Title: Re: How to show customfields on horizon browse page?
Post by: jenkinhill on May 13, 2016, 18:40:39 PM
Using default VM templates when selecting products_horizon the customs show below the product image.  So the question is, are you using template overrides? If so compare the overrides with the default sublayout files, and also check the positions assigned to the customs.
Title: Re: How to show customfields on horizon browse page?
Post by: RobertL on May 13, 2016, 21:00:38 PM
Thanks for the response. They are all default with no overrides, only override I use is for price sublayout (call for price), but it's only a modified original price file with nothing removed, only an icon added, and customs didn't show before that was changed.

I tried all variants now, it only shows in browse page when addtocart layout position is specified. It does however mess up the product detail page then. Ideally I wanted to position it between description and ask for price. I guess I can do that in
views/productdetails/tmpl/default.php mentioned in  https://forum.virtuemart.net/index.php?topic=97419.0 thought that may be just for product detail , not browse page.

Title: Re: How to show customfields on horizon browse page?
Post by: PRO on May 17, 2016, 19:54:52 PM
Quote from: RobertL on May 13, 2016, 21:00:38 PM
it only shows in browse page when addtocart layout position is specified.


because you have to specify the position

THIS CODE WILL SHOW A CUSTOM ON BROWSE PAGE, you just have to change the position name

      <?php if (!empty($product->customfieldsSorted['POSITION-NAME']))   {      
   foreach ($product->customfieldsSorted['POSITION-NAME'] as $field) {
echo $field->display;
      } } ?>