Hello,
I need to get Latest Products and Recently Viewed Products after Products in the category page
I searched since many days but I didn't find where to set that or where to change files
Joomla! 3.9.8
Virtuemart 3.4.2
I hope really getting some help on this matter
Best regards
Create a new 'VirtueMart Products' module, configure it's settings, assign only the category you want to attach it to in the 'Menu Assignment' tab and publish it in a template position below the main content area.
Hello,
Thank you
@jjk I found a real difficulties with the design of my template
So the best thing for me would to revert them in the category template
Any help please ?
Thank you
Quote from: amorino on July 21, 2019, 06:30:05 AM
@jjk I found a real difficulties with the design of my template
Which template? And what is the problem with the template?
Do an override from file JOOMLAROOT/components/com_virtuemart/views/category/tmpl/default.php
echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$this->products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));
is the code to render all the products
If you want to render it in another order, the only solution is to invert/manipulate the array : $this->products.
Hello,
Thank you @Studio 42
Yes that's it I just want to invert that array
How to do it please ?
How that code should be to invert ?
https://www.php.net/manual/en/function.array-reverse.php (https://www.php.net/manual/en/function.array-reverse.php)
$products= array_reverse($this->products, true);
echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));
Hello Studio 42
This didn't work for me
But I made an other try that worked fine :
echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$this->products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));
I think that this should be rendered in some template as now I want to revert new products and last seen on the same page hhhhhh
Any idea which code is rendering this
have you add the line in the right file
$products= array_reverse($this->products, true);
and change
echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$this->products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));a layout
with
echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));
If yes, then my code should work.
I cannot help you, if you dont know how to do overrides in the template
Hello,
Thank you a lot
I did overrides in the template with no problem
I found the solution and worked well in my previous message
But now I want to change order of blocks new products and last seen on the same cat page
if you want to customise the order then you have to manipulate the array $this->products directly or do a new array and add the products list(new, last ...) as you want.
Hello Studio 42
Thanks
Any example of code please ?
Thanks
$lists = array();
$lists['related'] = $this->products['related'];
$lists['featured'] = $this->products['featured'];
$lists[0] = $this->products[0];
echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$lists,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating);
note that i replaced $this->products by $lists in
shopFunctionsF .... array('products'=>$lists
If you dont understand, then please hire someone to do it, it's really a basic PHP code