News:

Support the VirtueMart project and become a member

Main Menu

show categored products on product detail page

Started by gpessoa, February 27, 2021, 20:47:22 PM

Previous topic - Next topic

gpessoa

Is there a way to echo this module to show products filter from the last category tree that the product is in?

This it will do for me!
Maybe better then using unpublished categories condition.
J 4.4.4; VM 4.2.6; PHP 8.3.6

Studio 42

Quote from: gpessoa on March 02, 2021, 18:50:53 PM
Is there a way to echo this module to show products filter from the last category tree that the product is in?

Have you try to show the standard product module ? You can choose to show product from current category, so it should work

gpessoa

QuoteHave you try to show the standard product module ? You can choose to show product from current category, so it should work


Yes, I'm using standard Virtuemart Module "mod_virtuemart_product" but I need a condition  to only show products from the last category tree that product belongs!
and in the module Category filter, there are not that item to select;

only Top Level Category and also all categories on the system...

The solution could be:
-   Add php code to "mod_virtuemart_product" to allow also filtering by Last Category Level

-   Or a code condition to only echo the Last Category Level products
        (this code need to be completed)
<div class="related-colours">
<?php //shows related colours by last category level
if (VmConfig::get('category'0) == 1) {   
if (!empty(
$this->product->category)){   

 echo 
'{module related-colours}';

}
}
?>

J 4.4.4; VM 4.2.6; PHP 8.3.6