Author Topic: label on the category page  (Read 1323 times)

Елeна

  • Beginner
  • *
  • Posts: 19
label on the category page
« on: May 12, 2020, 07:11:05 am »
Hello.
VirtueMart 3.6.10 / Joomla! 3.9.12 / protostar / site

To display the label "new" "sale" on the category page I use a Custom Field 'Image'
To output to a file \templates\protostar\html\com_virtuemart\sublayouts\products.php
code
Code: [Select]
  // Show Products ?>
<div class="product vm-col<?php echo ' vm-col-' $products_per_row $show_vertical_separator ?>">
<div class="spacer product-container">
<div class="vm-product-media-container">
               <?php echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$product,'position'=>'yarl'));?>
               <?php echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$product,'position'=>'yarl1'));?>
               <?php echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$product,'position'=>'yarl2'));?>
<a title="<?php echo $product->product_name ?>" href="<?php echo $product->link.$ItemidStr?>">
<?php
echo $product->images[0]->displayMediaThumb('class="browseProductImage"'false);
?>

</a>

</div>

It works, but the shortcuts are above the main image. screen
Labels should be next to the main image.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10300
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: label on the category page
« Reply #1 on: May 12, 2020, 08:59:12 am »
surround the labels with an absolute positioned div and make .product-container position relative

then u can position the labels where ever u want
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Елeна

  • Beginner
  • *
  • Posts: 19
Re: label on the category page
« Reply #2 on: May 12, 2020, 09:26:26 am »
Thank you for participating.


Thank you very much for your help!
The method works perfectly!

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1242
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: label on the category page
« Reply #3 on: May 12, 2020, 11:34:32 am »
New is internal function Virtuemart for every product.
Sale is internal function Virtuemart on every product detail in admin (checkbox).

Then you don't need create customfield and forcing administrators to fill in additional information is unproductive.
Better, develop correctly following this information.

Or you can use one of the existing plugins to create labels.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

Елeна

  • Beginner
  • *
  • Posts: 19
Re: label on the category page
« Reply #4 on: May 12, 2020, 12:36:35 pm »
Please, where in the creation of the product there is a shortcut output to the category page, without using the plugin.
There are many products in the category and only two new ones. One of them is light, the other is heavy.
the label on the product: "new" "heavy"
the label on the product: "new "" light"
Thank

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1242
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: label on the category page
« Reply #5 on: May 12, 2020, 14:59:25 pm »
Quote
Please, where in the creation of the product there is a shortcut output to the category page, without using the plugin.

New == date of creation product is saved in DB. Then if you don't use plugin, then must call DB and select all product which is new (setup how long time is for new :)
This select  you must save as value and then create if else for every product on category view and after yes, then put label to sublayout product.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates