Author Topic: create an extra category view  (Read 987 times)

2cool

  • Jr. Member
  • **
  • Posts: 236
create an extra category view
« on: October 30, 2018, 17:43:22 pm »
Hi,
How can I add an extra category view to use for some categories. (used to display just sale price. Not normal and saleprice.)
I'm using a template but got confused about what file should be modified and where this should be placed.

Can't find info for latest version VirtueMart 3.4.2.

Thanks in advance,

Pas

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4225
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: create an extra category view
« Reply #1 on: October 30, 2018, 20:03:03 pm »
templates/yourtemplate/html/com_virtuemart/category/myown.php
myown is a copy of default.php view your changes, but price use sublayout so you need to modify productsLayout too and price layout

2cool

  • Jr. Member
  • **
  • Posts: 236
Re: create an extra category view
« Reply #2 on: October 31, 2018, 09:07:02 am »
Thank you,

But where should I change the price and productslayout...is this in sublayouts?
Should these be renamed to prices_myown.php and products_myown.php?
and how can I make sure these are used in my custom category layout myown.php?

Thanks and regards,

Pas

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4225
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: create an extra category view
« Reply #3 on: October 31, 2018, 09:35:26 am »
when you create a new layout, you see it backend on edit a category
 in the list Category Layout :
default
myown
So you can switch to this layout
Else you can change directly Sublayouts for products in category
Any products Sublayouts are in sublayouts and begin with products_XXX.php
The prices are displayed using
Code: [Select]
echo shopFunctionsF::renderVmSubLayout('prices',array('product'=>$product,'currency'=>$currency));and you can change for eg too
Code: [Select]
echo shopFunctionsF::renderVmSubLayout('myprices',array('product'=>$product,'currency'=>$currency));to use file .../sublayouts/myprices.php to render the prices list.
So it depend your needs

2cool

  • Jr. Member
  • **
  • Posts: 236
Re: create an extra category view
« Reply #4 on: November 01, 2018, 11:37:15 am »
Thanks for the explanation.

I created the new files(duplicate and rename) and I can choose these in category config.
But I don't see any products in the category on front end.

What could be wrong?

Thanks,
Pas

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4225
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: create an extra category view
« Reply #5 on: November 01, 2018, 17:46:26 pm »
You have to verify using php vardump or vmdebug if the right files are loaded.