Author Topic: VM2.0.0 - Can I set template for featured products (or override the template)?  (Read 9098 times)

koumei

  • Beginner
  • *
  • Posts: 11
In Extensions - Module Manager I can add featured products module ok.

But I would like to set the template featured products. How can I override the featured products template? Anyone can help?

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10385
  • VirtueMart Version: 3+
the module or the featured products on homepage?
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

koumei

  • Beginner
  • *
  • Posts: 11
the module or the featured products on homepage?

It is featured products on home page, i want to change its template.

JtouchMobile.com

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 96
  • Mobile Solutions for VirtueMart 2
    • JtouchMobile.com
/components/com_virtuemart/views/virtuemart/tmpl is the folder you would like to take a look in ;)
Author of Jtouch - Mobile solution for Joomla & VirtueMart
http://www.jtouchmobile.com

koumei

  • Beginner
  • *
  • Posts: 11
/components/com_virtuemart/views/virtuemart/tmpl is the folder you would like to take a look in ;)

You are right. My concern of this if I modify the code in here, next time VM2 update would probably override my changes...

koumei

  • Beginner
  • *
  • Posts: 11
I understand i can override the template of that folder, but if i override it, the home page featured product template is changed and also all the product list changed. in this case, i just want to change the template of home page featured product.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10385
  • VirtueMart Version: 3+
do a template override
http://forum.virtuemart.net/index.php?topic=90935.0

NOT modify the file
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

koumei

  • Beginner
  • *
  • Posts: 11
do a template override
http://forum.virtuemart.net/index.php?topic=90935.0

NOT modify the file

Maybe I did not ask my question clearly.

The template of Home Featured Product and Product List template they are the same, correct? So If I override the template in /mytemplate/html/mod_virtuemart_product/default.php, both home featured product style and product list style are changed. My question is how to have different template for home featured product and product list?

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10385
  • VirtueMart Version: 3+
use 2 different module, and you can do a moduleclass suffix

or create 2 views
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

koumei

  • Beginner
  • *
  • Posts: 11
use 2 different module, and you can do a moduleclass suffix

or create 2 views

thanks for you replies :-P I believe it is very helpful!~

moduleclass suffix does not work for me, because i am not only use style sheet.

How do you mean create 2 views? Thanks.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10385
  • VirtueMart Version: 3+
the the module/tmpl

you can copy default.php

and rename it to  modified.php

THEN, in the module settings there is a dropdown for layout.
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

koumei

  • Beginner
  • *
  • Posts: 11
the the module/tmpl

you can copy default.php

and rename it to  modified.php

THEN, in the module settings there is a dropdown for layout.

Module type "Virtuemart Products" does not have dropdown list for the layout.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10385
  • VirtueMart Version: 3+
What I do IN MY JOOMA template is have specific module position for category, and productdetails view


SO, this code below creates a module position for the default virtuemart view


<?php if (JRequest::getVar('view')=='virtuemart') { ?>
<div id="positiondiv"><jdoc:include type="modules" name="modulename" /></div>
<?php } ?>


J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

koumei

  • Beginner
  • *
  • Posts: 11
What I do IN MY JOOMA template is have specific module position for category, and productdetails view


SO, this code below creates a module position for the default virtuemart view


<?php if (JRequest::getVar('view')=='virtuemart') { ?>
<div id="positiondiv"><jdoc:include type="modules" name="modulename" /></div>
<?php } ?>

Thank you very much for the solution. Merry Christmas!!

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10385
  • VirtueMart Version: 3+
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)