Author Topic: Shows all products from subcategories in parent categories (all branch)  (Read 32019 times)

vmbuilder

  • Beginner
  • *
  • Posts: 21
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #15 on: August 12, 2011, 12:27:01 pm »
Got it! To hide column headings above product listings: http://forum.virtuemart.net/index.php?topic=88352.msg294536#msg294536

Cheers.
Joomla 1.5.23 VM 1.1.19

vmbuilder

  • Beginner
  • *
  • Posts: 21
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #16 on: August 12, 2011, 12:36:48 pm »
Hello,
I have question: is posssible to adjust numbers of sub categories in one row?

Yes it is, edit file:

Code: [Select]
joomla\components\com_virtuemart\themes\default\templates\common\categoryChildlist.tpl.php
Line 8, choose how many you want..!

Code: [Select]
if( !isset( $categories_per_row )) {
$categories_per_row = 3;
}
Joomla 1.5.23 VM 1.1.19

Mav3rick

  • Beginner
  • *
  • Posts: 7
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #17 on: August 14, 2011, 20:19:21 pm »
4 all
if you dont want to show products of subcategories in their parent categories (shows only links to subcategories in menu), simply change file shop_browse_queries.php back to the starting state. But if you want to great functionality of whole virtuemart, every product have to be added to the end of some branch. If someone would be in category which have some children(in the middle of some branch) it cant works great. Try to draw it on the paper... (Of course if you want to shows only links to subcategories, not products of subcategories). If you want to show products too, thats another case, their would be shown twice (with my code editation). I hope I helped you.

fonza

  • Beginner
  • *
  • Posts: 3
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #18 on: August 18, 2011, 18:43:29 pm »
Thank you vmbuilder, that help me.

agiovacchini

  • Beginner
  • *
  • Posts: 2
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #19 on: August 20, 2011, 08:38:54 am »
Thank you so much Mav3rick, I was just looking for this!

relco

  • Beginner
  • *
  • Posts: 5
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #20 on: August 21, 2011, 22:57:42 pm »
I've been looking for an answer for 2 weeks regarding this... Please anyone?

All the products from subcategories are displayed successfully.  Is there a way to display the category/subcategory name title aswell?

At the moment all products appear to be under no category. How can I display each of the category names?

voidkun

  • Beginner
  • *
  • Posts: 9
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #21 on: September 03, 2011, 00:50:10 am »
dude youre a legend, got it working fine in VM 1.1.8  :P

girkers

  • Beginner
  • *
  • Posts: 14
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #22 on: September 05, 2011, 13:36:02 pm »
I am trying to show the subcategories underneath the parent category (which are empty) however I don't have a html directory as specified in the first post. Where do I find the html directory so that I can implement this.

[edit] I feel like a right idiot, I re-read the original message and found that the html directory is in the /administrator/... folder, this doesn't make sense to me to have a front-end page in the administrator section. Oh well, thanks OP as I now have it working[/edit]

Thanks

Girkers
--

Garth Kirkwood

mpfteam

  • Beginner
  • *
  • Posts: 6
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #23 on: November 14, 2011, 17:26:56 pm »
accodring to instructions below it says to go file shop_browse_queries.php in the specified path.... but... i don't have that file. i edited the shop_browse.php and it's not the same...

can you please verify that php file for me?

thank you.



Problem with not showing subcategories when you enter to category. I couldn't find any solution on the internet so I coded my solution. Here it go:

---------------------------------------------------------------
file
Code: [Select]
administrator/components/com_virtuemart/html/shop_browse_queries.php
---------------------------------------------------------------

after
Code: [Select]
mm_showMyFileName( __FILE__ ); (about row 20)

insert this code
Code: [Select]
class children_class{
    var $cat_children; // where clause
    var $db_browse; // db controler

    function get_children($parent){
        $q  = "SELECT `category_child_id` FROM `#__{vm}_category_xref` WHERE `category_parent_id`=$parent";
        $this->db_browse->query($q);
        $cat_children_id = array();
    while ($this->db_browse->next_record()){
        array_push($cat_children_id,$this->db_browse->f("category_child_id"));
    }
    foreach($cat_children_id as $cat_child_id){
        $this->cat_children .= " OR `#__{vm}_product_category_xref`.`category_id`=$cat_child_id";
        $this->get_children($cat_child_id);
    }

    return $this->cat_children;
    }
}
---------------------------------------------------------------

after
Code: [Select]
// Filter Products by Category (about row 70)

replace this code
Code: [Select]

if( $category_id ) {
if( !empty( $search_this_category ) && (!empty( $keyword ) || !empty( $manufacturer_id ) )) {
$where_clause[] = "`#__{vm}_product_category_xref`.`category_id`=".$category_id;
} elseif( empty( $keyword ) && empty( $manufacturer_id )) {
$where_clause[] = "`#__{vm}_product_category_xref`.`category_id`=".$category_id;
}
}
by this
Code: [Select]
if( $category_id ) {
        if( !empty( $search_this_category ) && (!empty( $keyword ) || !empty( $manufacturer_id ) )) {
               $where_clause[] = "`#__{vm}_product_category_xref`.`category_id`=".$category_id;
    } elseif( empty( $keyword ) && empty( $manufacturer_id )) {
         $cat_child = "(`#__{vm}_product_category_xref`.`category_id`=".$category_id."";

           // Find Child Category Products
           $children = new children_class;
           $children->db_browse = $db_browse;
           $cat_child .= $children->get_children($category_id);
           $cat_child .= substr($this->cat_children, 0, -3);
           $cat_child .= ")";
           $where_clause[] = $cat_child;
       }
}
---------------------------------------------------------------

After save the file it will shows recursively all products from subcategories and their subcategories  in parent cateogy to the end of the branch.
---------------------------------------------------------------

all edited file
Code: [Select]
http://pastebin.com/iP5nzkud
Sorry for my english  :-[

raffo64

  • Beginner
  • *
  • Posts: 1
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #24 on: November 15, 2011, 10:59:43 am »
Probably you are using Dreamviewer... try with another browser and you'll find what are you looking for!!"shop_browse_queries.php"

nehogymar

  • Beginner
  • *
  • Posts: 8
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #25 on: December 08, 2011, 17:47:45 pm »
Joomla 1.5.22
VM1.1.9

I followed the inrstuction above mentioned, but I've got:

Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /web/mysite/mysite.com/subdir/administrator/components/com_virtuemart/html/shop_browse_queries.php on line 23

line 23:
Code: [Select]
$DescOrderBy = strtoupper($vm_mainframe->getUserStateFromRequest( "browse{$keyword}{$category_id}{$manufacturer_id}DescOrderBy", 'DescOrderBy', "ASC" ));
Anybody can help me?
Thanks in advance

mkariti

  • Jr. Member
  • **
  • Posts: 75
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #26 on: December 13, 2011, 09:19:52 am »
Hi there,
Many thanks for the great job!!!
I apply this and it work like a charm! However, for some reason I get the sort by option in the suncategories section. I dont have any products there only subcategories and hence I dont need it to show the sort by. Does anyone know how to take this off?
I dont want to disable it just not to show in the subcategories.
Many thanks
mkariti

maszyny

  • Beginner
  • *
  • Posts: 1
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #27 on: December 13, 2011, 11:31:18 am »
Thanks very much :)

I have trouble - i can't remove link from Parent Categories, not subcategories/products. Is it possible to do it?
or though display first product...

sample menu:

xxx  // after click I would like don't show all product only view list product in menu or after click show description first product in window
  yyy
  yyy
  yyy
zzz
  aaa
  bbb
  ccc

Please help me, i am beginer in virtualmarket

nehogymar

  • Beginner
  • *
  • Posts: 8
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #28 on: December 19, 2011, 07:43:45 am »
Works, thanks!

carbon-uk

  • Beginner
  • *
  • Posts: 29
Re: Shows all products from subcategories in parent categories (all branch)
« Reply #29 on: January 31, 2012, 11:47:11 am »
I've been looking for an answer for 2 weeks regarding this... Please anyone?

All the products from subcategories are displayed successfully.  Is there a way to display the category/subcategory name title aswell?

At the moment all products appear to be under no category. How can I display each of the category names?

Also looking for this??? Anybody?