Guest Posted April 19, 2007 Posted April 19, 2007 Hello All If anyone can help with the questions below I'd be most grateful. I have 3 main questions. How would I code a link to an individual category manually? Is it possible to output 4 sub categories on to one page? Also is it possible to do this and not have the category appear in the category listing in the sites main navigation? A bit more detail so that you know what I'm trying to achieve here: You can see the site I'm working on at www.fasteronline.co.uk and What I want is for an area of the home page to point to 4 categories. Each category will contain around 4 sub-categories and these sub-categories will beout put on the page something like this image I have produced. In the image you'll see 4 areas each selling different types of cycle carriers. So in this example the category is Cycle Carriers with 4 sub-categories one for each type of cycle carrier - I really hope someone knows how this can be done. I just don't have any idea where to start. All help is most appreciated. Cheers Paul
oschellas Posted April 19, 2007 Posted April 19, 2007 Hello All If anyone can help with the questions below I'd be most grateful. I have 3 main questions. How would I code a link to an individual category manually? Hardcode the cPath in your link (example index.php?cPath=3_10). Note that if you change your category setup, you have to adjust the links. Is it possible to output 4 sub categories on to one page? Create a category with 4 subcategories and hardcode the link to that maincategory (example index.php?cPath=3). Note that if you change your category setup, you have to adjust the links. Also is it possible to do this and not have the category appear in the category listing in the sites main navigation? I don't understand your 3rd point and also I don't know to which image you are referring. :'( A bit more detail so that you know what I'm trying to achieve here: You can see the site I'm working on at www.fasteronline.co.uk and What I want is for an area of the home page to point to 4 categories. Each category will contain around 4 sub-categories and these sub-categories will beout put on the page something like this image I have produced. In the image you'll see 4 areas each selling different types of cycle carriers. So in this example the category is Cycle Carriers with 4 sub-categories one for each type of cycle carrier - I really hope someone knows how this can be done. I just don't have any idea where to start. All help is most appreciated. Cheers Paul
dittones Posted April 19, 2007 Posted April 19, 2007 Paul, Well I don't know of any contribution that would give you exactly what you want. Are you an Html and php coder? I would control weither to show in the area that you want by adding a additional field in the Product and Categories database which would be a switch that would control this...Then write code that would look for the switch info indicating that this is the only categories and product to show and the link info would be attached to the display image and so on...Using the same though go into the programs that display your regular products and categories check for a not equal in your sql scripts...I have sort of given you an idea... I hope this helps Roman dittone.com
Guest Posted April 19, 2007 Posted April 19, 2007 Paul,Well I don't know of any contribution that would give you exactly what you want. Are you an Html and php coder? I would control weither to show in the area that you want by adding a additional field in the Product and Categories database which would be a switch that would control this...Then write code that would look for the switch info indicating that this is the only categories and product to show and the link info would be attached to the display image and so on...Using the same though go into the programs that display your regular products and categories check for a not equal in your sql scripts...I have sort of given you an idea... I hope this helps Roman dittone.com Hello Dittones Thanks for the advice, I know my HTML and a little PHP and I did think of adding an indicator but I'm trying to find a way to avoid it, I may have to fall back on this though (I may need to get back to you on this if no easier method presents itself). Hello Oschellas Thanks for the advice, I think we may be getting somewhere :), I've just added a few extra bits. Is it possible to output 4 sub categories on to one page?Create a category with 4 subcategories and hardcode the link to that maincategory (example index.php?cPath=3). Note that if you change your category setup, you have to adjust the links. Pauls Reply: I think I mislead you here I would like the products within the sub-categories output as in the picture below (I stupidly forgot to attach it before). Also is it possible to do this and not have the category appear in the category listing in the sites main navigation? I don't understand your 3rd point and also I don't know to which image you are referring. :'( Pauls Reply: All my categories are output in a left menu but I don't want these categories to appear in teh menu just through the links on my home page. Just to clarify what I'm wanting to do here's the screen shot I forgot to attach before.
oschellas Posted April 19, 2007 Posted April 19, 2007 If I understand it well, you only want to show the main categories in the left menu. When clicking on the main menu link it will show the subcategories with their products on the right? If this is the case, it can be done but you have to code this and adjust some queries in the index.php page. Copy and rename the includes/modules/product_listing.php file, adjust the code to the desired layout and make a call to this file from the altered index.php section.
Guest Posted April 19, 2007 Posted April 19, 2007 If I understand it well, you only want to show the main categories in the left menu. When clicking on the main menu link it will show the subcategories with their products on the right? If this is the case, it can be done but you have to code this and adjust some queries in the index.php page. Copy and rename the includes/modules/product_listing.php file, adjust the code to the desired layout and make a call to this file from the altered index.php section. Hello Oschellas Pretty close. I'm planning on have 4 manually coded links on my home page linking to these categories. And then outputting the page as you described. Just 2 questions remain. 1. Can I do this with categories that are not included in the main navigation (which currently is produced by outputting a list of all categories)? 2. How do I get the sub-categories to display their products as in my pic? Is there a setting I'm unaware of? I really appreciate your help. Cheers Paul
oschellas Posted April 19, 2007 Posted April 19, 2007 Regarding the categories: Copy / rename includes/boxes/categories.php and adjust the query to query only categories with a parent_id = 0 (main category). When adding a new file I recommend to setup this file also in the filenames.php and in the language folder(s) (the way all files are handled in oscommerce). For the layout there is no simple setting available, you have to code this. For this I would create a div for each subcategory, style it with a left float and a width that is a little less then the half of your page width. In that div you can create an table with 2 cells, add rows dynamically depending on the products in that sub category. if($total_numrows%2==0)( echo '</tr><tr>'; }
Guest Posted April 19, 2007 Posted April 19, 2007 Regarding the categories: Copy / rename includes/boxes/categories.php and adjust the query to query only categories with a parent_id = 0 (main category). When adding a new file I recommend to setup this file also in the filenames.php and in the language folder(s) (the way all files are handled in oscommerce). For the layout there is no simple setting available, you have to code this. For this I would create a div for each subcategory, style it with a left float and a width that is a little less then the half of your page width. In that div you can create an table with 2 cells, add rows dynamically depending on the products in that sub category. if($total_numrows%2==0)( echo '</tr><tr>'; } Thanks oschellas - I think I may be able to work this out now. I'll be OK with the styling, it's the osCommerce/PHP aspects I find harder. I'll give it a go though. Once again thanks a lot you've helped out a lot. Cheers Paul
Recommended Posts
Archived
This topic is now archived and is closed to further replies.