VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Products, Prices, Tax and Categories VM 1.1 => Topic started by: asura on July 29, 2008, 10:32:40 am

Title: customize virtuemart sub-category
Post by: asura on July 29, 2008, 10:32:40 am
hi all
im new to virtuemart ..hope anyone here able to help me.
i created more than 1 sub-categories. I tried change to make
3 sub-categories in 1 row. But it shown 4 sub-categories in
1 row. Refer here (http://www.cindai.net/index.php?option=com_virtuemart&page=shop.browse&category_id=7&Itemid=29&vmcchk=1&Itemid=29). How can i change or customize it?
main category named TUDUNG. its have 4 sub-cat

how can i make 3 sub-categories in 1 row? thanks a lot
Title: Re: customize virtuemart sub-category
Post by: PINC on July 30, 2008, 06:55:52 am
I see 4 categories there. Is it fixed? Pictures do need resizing to look better on the fit of page.  ;)
Title: Re: customize virtuemart sub-category
Post by: akerman on August 01, 2008, 23:36:14 pm
In the file 'categoryChildlist.tpl.php' in /www-root/components/com_virtuemart/themes/your-theme/templates/common/..'

Change the following line to reflect your whish for three sub-cats in a row:
It's on row 5.

$iCol = 1;
if( !isset( $categories_per_row )) {
   $categories_per_row = "3";
}


Good luck


Regards
Akerman
Title: Re: customize virtuemart sub-category
Post by: asura on October 24, 2008, 05:14:07 am

thanks ..

sori ..its take so long for to reply


thanks a lot bro ..

Title: Re: customize virtuemart sub-category
Post by: bunak on November 14, 2008, 13:13:42 pm
Hi!

I want to set one number of sub-categorie per row for shop main page.
and
I want to do the same - set three of sub-categorie per row for second level categories page
Title: Re: customize virtuemart sub-category
Post by: akerman on November 14, 2008, 18:02:09 pm
Hi,

not sure exactly what you mean. Setting the parameter above will give three (or four, five ... whatever you put in there  ;) Problem might be that you run out of space on the page...)

And this number is valid throughout the whole VM structure top-to-bottom. To get it to start on the 'second' level, takes some other measures. (Of which I don't know anything about. Not right now anyway.)

Hope you manage.

Regards
Akerman 
Title: Re: customize virtuemart sub-category
Post by: bunak on November 15, 2008, 18:31:00 pm
I want 3 categories per record on a first (main) page
In other level (when select main/first/ category) I want only 1 category per record.
Title: Re: customize virtuemart sub-category
Post by: akerman on November 21, 2008, 08:12:34 am
Hmm, I see.

There is a different layout for the front of the shop (where you're main categories are), separated from the category listing pages, but I think the category calculations in VM runs from top to bottom, without exception. That is, you set '3', well then it's going to be '3' al the way, no exceptions. n orderto changethis I think you have to make quite an extensive hack. (Quite sure you wont find it in here, since I haven't seen it yet... :-\)


You can of course simply set VM to show maximum 3 categories, as mentioned above and then just publish 1 category in the sub-categories.

The problem with VM is that if you publish categories and they are empty, they still will show up. I made a hack for this but do not remember the number of that thread. Search for my name and 'category' then you'll probably find it.

Hope it helps.

Regards
Akerman
Title: Re: customize virtuemart sub-category
Post by: bunak on November 29, 2008, 10:45:52 am
I do it. It so ease. :)

So.

VirtueMart 1.1

1. For set 3 numbers of categories on first (main) page need add code
/administrator/components/com_virtuemart/html/shop.index.php
Code: [Select]
$tpl->set( 'categories_per_row', 3 );
$categories = $tpl->fetch( 'common/categoryChildlist.tpl.php');

2. For set 1 number of categories on on other page need change
/components/com_virtuemart/themes/default/templates/common/categoryChildlist.tpl.php
Code: [Select]
$categories_per_row = 1
Title: Re: customize virtuemart sub-category
Post by: fortza on December 14, 2008, 20:26:30 pm
Cool....

...... can you also help me - I will have 1 category line on the left side ..... with a background color, and then a different background color for category 2, etc. ?

Best, Fortza
Title: Re: customize virtuemart sub-category
Post by: akerman on December 16, 2008, 09:18:03 am
Hi,

In short, all category 'objects' collect their styling from the same code.

In order to achieve different looks for a ' category column' or 'category row', you would need to rewrite the VM code.

In order to successfully do that you need at least to install and learn the basic use of the following tools: Firebug and Web Developer Tools. Look on Google for these and in the Firefox addons. 

Maybe an alternative is to use another template for the VM category pages? (Not sure if it can be done, since addressing of the specific VM component pages isn't easy in Joomla!.)


I'm not saying it can't be done or even that I'm 100% right, but it will for sure involve some intricate hacking.

Sorry for not being to able to help further, hope you manage. 

Regards
Akerman
Title: Re: customize virtuemart sub-category
Post by: fortza on December 17, 2008, 09:13:41 am
Hi Akerman.


Thanks for your response on. category / product template ..... I have send your answer to a programmer for the task.

I have also just another question for you - it seems as though you have much control over VM :-)

When I insert a product image, and later regret the deployment - I can not remove it again, I have been immersed ftp ..... removed the pictures, and now there is just a red cross, can you can help me with this issue ...?

Have another question ...... but by then not just whether I dare asking you ......


Greetings, Fortza
Title: Re: customize virtuemart sub-category
Post by: akerman on December 19, 2008, 11:13:21 am
Hi,

sorry for the delay...Christmas is coming... :D

In order to successfully remove the product image or any additional image / file in VM you can follow the images below.

Click the items/links in the red circles. These are the only places inside the backend where you can delete an image.

I guess you've tried the normal approach (the image w the chainsaw below) already. In that case try the other approach.

Regards
Akerman   

[attachment cleanup by admin]
Title: Re: customize virtuemart sub-category
Post by: effeebee on March 01, 2009, 13:44:09 pm
Akerman, that's a great tip. I set the categories per row to 3 and restyled the table to 75% align center. It looks perfect, thanks!
Title: Re: customize virtuemart sub-category
Post by: fortza on March 03, 2009, 13:29:56 pm
Hi Akerman

Thats okay  ;D

I need your help on a WERY importent mater......when the site is running in catalog mode.....the costumer have an opportunity to ask about a price on a product .... how/where do I change this form of contact email ...... I will add some more fields .....

i REALY hope that yoy will help med FAST in this issue/questions

The WERY best, Fortza
Title: Re: customize virtuemart sub-category
Post by: nadrm on October 27, 2009, 22:34:36 pm
could be useful to separate "template" of subcategories in Home Page from "template" of other pages of site.
With this in mind:
1. For set 3 numbers of categories on first (main) page need add code
/administrator/components/com_virtuemart/html/shop.index.php
Code:
$tpl->set( 'categories_per_row', 3 );
$categories = $tpl->fetch( 'common/categoryChildlist.tpl.php');


2. For set 1 number of categories on on other page need change
/components/com_virtuemart/themes/default/templates/common/categoryChildlist.tpl.php
Code:

$categories_per_row = 1

Simply create a new file called like: categoryChildlist.Home.tpl.php, personalize and use it only for Home Page, and left categoryChildlist.tpl.php for all remaining pages.
Hope may be useful to everybody!
Title: Re: customize virtuemart sub-category
Post by: bunak on May 08, 2010, 18:15:43 pm
Simply create a new file called like: categoryChildlist.Home.tpl.php, personalize and use it only for Home Page, and left categoryChildlist.tpl.php for all remaining pages.
Hope may be useful to everybody!
Yes, it is a good idea. But how create and integrate the new "Home Page" template to the VM without do global change in scripts?