VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Елeна on March 10, 2019, 21:38:07 PM

Title: Custom Field "image" for category page
Post by: Елeна on March 10, 2019, 21:38:07 PM
Hello.
VirtueMart 3.4.2 / Joomla! 3.8.12 / protostar/ site (http://uchilka.01sh.ru/magazin-uk/sport-kostyum-uk)


Tell me how to implement correctly:
In the category all products are the same, and one is special. It is necessary to highlight it by labeling the picture
Thanks
Title: Re: Custom Field "image" for category page
Post by: Jörgen on March 11, 2019, 07:11:08 AM
Assign special ccs rule to the image in product details ?

Or

Assign the product as "on featured" and customize the view in your template files ?

Jörgen @ Kreativ Fotografi
Title: Re: Custom Field "image" for category page
Post by: Елeна on March 11, 2019, 07:39:06 AM
Thanks for participating
QuoteAssign special ccs rule to the image in product details ?
The codes I found on the Internet do not work with VirtueMart3
...\templates\protostar\html\com_virtuemart\sublayouts\products
In this file, you must insert the code that displays a custom field.
If there is a worker - tell me

QuoteAssign the product as "on featured" and customize the view in your template files ?
Additional plugin required. I only have one product that needs a label.
Thanks for your help
Title: Re: Custom Field "image" for category page
Post by: jenkinhill on March 11, 2019, 10:06:09 AM
See https://forum.virtuemart.net/index.php?topic=122996.0

and

https://forum.virtuemart.net/index.php?topic=140526.0
Title: Re: Custom Field "image" for category page
Post by: Елeна on March 11, 2019, 10:27:02 AM
plugin  "BIT-Virtuemart-Product-Badges-3.0.2"  eat
I do not want to install for the sake of one product.

solution for VirtueMart2
<?php echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$product,'position'=>'normal'));?>

need code for VirtueMart3

Thanks for participating
Title: Re: Custom Field "image" for category page
Post by: Studio 42 on March 12, 2019, 23:36:04 PM
try to enable customfields display in category in the Virtuemart config
or add a class in the product sublayout per product the code should be
<div class="vm-product-media-container">
to
<div class="vm-product-media-container<?php echo ' productcontainer-'.$product->virtuemart_product_id; ?>">
so you can set css per product
Of course if you have plenty of products, it's not the right way.