News:

Looking for documentation? Take a look on our wiki

Main Menu

Category Listing: I don´t want to see the products

Started by piru, May 28, 2013, 10:19:27 AM

Previous topic - Next topic

piru

Hello,

In the Category Listing I see all categories (this is ok), but I see under the categories the products too. How can I make if I want to see only the categories, without products? I want to see the products only when I click the category.

The site isn´t online to gib you an URL, but I made a screenshot.

Thanks!
piru

[attachment cleanup by admin]

balai

I don't think that its possible.

The category links are there to return products. If you don't want that you can remove the products from these categories

piru

I think you don´t understand what I want (sorry for my english). Obviously I want to see the products when I click the category (the products from the category), but in this view I´m not in any category, I see only wich categories I have, and I can click in whichone I want to go.
I´m in Home - Products, why muss I see the products, the in the category are?
I want to see them only if I´m in Home - Products - Hunting Items

balai


piru

\components\com_viertuemart\views\category\tmpl\default.php

piru

sorry, I think is \components\com_viertuemart\views\categories\tmpl\default.php

balai

Go to the VM configuration->Templates and check the Hope Page settings

piru

I made it before, look how the settongs are in the screenshot, I think there is nothing more to do there...

[attachment cleanup by admin]

piru

Now is the site online, I can give you a link to see what I mean: http://k-urz.de/v4c
In the first post I made a screenshot, to show what I don´t want so see.


piru

I just fixed this problem with a dirty trick.

components\com_virtuemart\views\category\tmpl\default.php
Line 32 after: jQuery(document).ready(function () {
this
if(jQuery('div.category-view').length>0) jQuery('div.browse-view').hide();


byPV

Hi,

I'm sorry that I have to say, but it's really horrible solution.

1) If you do not need a some code, so do not generate it => slower loading pages
2) Hiding using javascript is a bad habit =>
2a) if the page or the client PC will be slow, so the block disappears after the page is loaded (it will be seen)
2b) if a user has javascript disabled in browser or there is a javascript error, so a remaining javascript code is not executed (your block remains visible)

You can use this PHP condition in the view:


.....
<?php if (empty($this->category->haschildren)) { ?>
<div class="browse-view">
......
......
......
</div><!-- end browse-view -->
<? } ?>


Regards,
Pavel

PS:I have not tested it, but it's not complicated, so I suppose it will work;-)

piru

Hi Pavel,

Quote from: byPV on April 24, 2014, 19:56:55 PM
I'm sorry that I have to say, but it's really horrible solution.

Quote from: piru on April 24, 2014, 14:22:23 PM
I just fixed this problem with a dirty trick.
;)

I didn´t get a solution before, beause of thi I had to do something.
But now I did it with your solution, it works perfectly!!

Thanks  :D

Regards piru




piru

I just find a problem with your solution, the search doesn´t work more.
If I try to find something: No result   
I have to make again mine horrible solution... :(

Regards piru

byPV

Hi,

change the condition to:


<?php if (empty($this->category->haschildren) || !empty($this->keyword)) { ?>


Regads,
Pavel

piru

now works perfectly,

thanks Pavel!  :)

Cheers piru