Guest Posted August 5, 2005 Share Posted August 5, 2005 Hi new to Cube Cart (using 3.0.1), and using it in a current project. The store will have multiple categories, and multiple levels of categories. What I'm wanting to do is when a user is looking at a product or category page, where currently we have (Product page shows Location: instead of the Products In:) Products in: >Top Level Category>Sub-Category with 'Top Level Category' as a link but 'Sub-Category' isn't - would like to have 'Sub-Category' also as a link. This would be especially useful on a product page, as it would allow the user to go back to the listing of all products in the same category as the product currently being viewed. [site can be viewed at www.webpres-linux.co.uk/store - just working on gettin it fully functional before skinning thye site.] Any help would fully appreciated. Quote Link to comment Share on other sites More sharing options...
Guest Posted August 8, 2005 Share Posted August 8, 2005 I have worked this out now, so this topic is extraneous and may as well be deleted. Thank you. Quote Link to comment Share on other sites More sharing options...
Guest Posted August 8, 2005 Share Posted August 8, 2005 Maybe it will be helpful to other members if you show what you did so other members can do the same thing :^^: Quote Link to comment Share on other sites More sharing options...
Guest Posted August 9, 2005 Share Posted August 9, 2005 Me -> doh!! *slaps head* My apologies. All you need to do:- in the file functions.inc.php (in the 'includes' dircectory) go to the 'Get Category Directory' sectionfind the following line : $dirArray[0] = $config['dirSymbol'].$catNameand change it something similar to this : $dirArray[0] = $config['dirSymbol']." <a href='".$GLOBALS['rootRel']."index.php?ccUser=".$sessId."&catId=".$catId."&act=viewCat' class='txtLocation'>".$catName."</a> ";Doing that got the desired affect, that I was after. I'll get back to you on having a link to the homepage, as *the* top-level link, as I havent sorted this yet. But it should be easy enough, just by adding an a suitable value in the $lang['front']['viewCat'] and $lang['front']['viewProd'] arrays (may be able to get by with just adding a new array to hold the link - probably a better idea) in language/en/lang.in.php Then in both viewCat.inc.php and viewProd.inc.php adding a line similar to: $view_cat->assign("TXT_LINK_HOME",array_identifier); After which it should just be a case of edting the viewCat.tpl and viewProd.tpl files (in skins/your-skin/styleTemplates/content/) to show the link. Quote Link to comment Share on other sites More sharing options...
Guest Posted August 10, 2005 Share Posted August 10, 2005 For the site home link: (i.e. Site Home > Top Level Category > Sub-Category) 1. in language/en/lang.inc.php, create a new array to store the clickable text of the link $lang['front']['showLinks'] = array( 'home' => "Store Home", ); 2. in includes/content/viewCat.inc.php change $view_cat->assign("LANG_CURRENT_DIR",$lang['front']['viewCat']['products_in']); to $view_cat->assign("TXT_LINK_HOME",$lang['front']['showLinks']['home']); and in includes/content/viewProd.inc.php change $view_prod->assign("LANG_DIR_LOC",$lang['front']['viewProd']['location']); to $view_prod->assign("TXT_LINK_HOME",$lang['front']['showLinks']['home']); All that remains now is to display the link on the site. This is done by editing the viewCat.tpl and viewProd.tpl files. These are found under the skins directory for whichever skin you are currently using. E.g. if you were using the Classic skin, the two files would be found under skins/Classic/styleTemplates/content/ 3. in viewCat.tpl change <div><strong>{LANG_CURRENT_DIR}</strong> {CURRENT_DIR}</div> to <div><a href="index.php" class="txtDefault">{TXT_LINK_HOME}</a> {CURRENT_DIR}</div> and in viewProd.tpl change <strong>{LANG_DIR_LOC}</strong> {CURRENT_DIR} to <a href="index.php" class="txtDefault">{TXT_LINK_HOME}</a> {CURRENT_DIR} Hope this is useful to folks. Quote Link to comment Share on other sites More sharing options...
Guest turtle Posted October 14, 2005 Share Posted October 14, 2005 This was very helpful and is working perfectly - thanks! I do have a question though: when a category (category/) is filled with ONLY sub-categories (category/subcategory) but no products within the first category (category/product) the breadcrumb disappears. I've seen other sites that have breadcrumbs show in all pages regardless... Your guidance is greatly appreciated, thanks in advance. Quote Link to comment Share on other sites More sharing options...
Guest sunshine Posted October 16, 2005 Share Posted October 16, 2005 Wow, thank you WebPresentations This is great great GRAND I'm going to put this in tomorrow and see how it goes. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 17, 2005 Share Posted October 17, 2005 This was very helpful and is working perfectly - thanks! I do have a question though: when a category (category/) is filled with ONLY sub-categories (category/subcategory) but no products within the first category (category/product) the breadcrumb disappears. I've seen other sites that have breadcrumbs show in all pages regardless... Your guidance is greatly appreciated, thanks in advance. This is something I have started to notice as well, not entirely sure why this is happening. I will be looking into this in the next day or two, and I'll get back to as soon as I have worked out why this should happen (hopefully with a fix as well !!) Quote Link to comment Share on other sites More sharing options...
Guest Posted November 1, 2005 Share Posted November 1, 2005 Right, To sort the problem of no breadcrumb navigation showing on categories which have no product .... in viewCat.inc.php look for the 'repeated region' section look for the following statement } elseif(isset($_GET['searchStr'])) { there should be 'else' statement nearby insert the following code, after the closing brace } $view_cat->assign("TXT_LINK_HOME",$lang['front']['showLinks']['home']); $view_cat->assign("CURRENT_DIR",getCatDir($currentCat[0]['cat_name'],$currentCat[0]['cat_father_id'], $currentCat[0]['cat_id'], $link=TRUE)); this should be sitting above the 'no products' code, i.e. $view_cat->assign("TXT_NO_PRODUCTS",$lang['front']['viewCat']['no_prods_in_cat']); $view_cat->parse("view_cat.noProducts"); I just now need to sort something similar for a search results page (viewCat.inc.php again). Anyway hope this helps for now. I'm off to try and wrap my head around how to have a copy of the shopping cart box on a brochure site linked to a Cube Cart store. Having nightmarish problems with sessions. (Mainly because the brochure site is content managed with its own session, and the shopping cart box needs a session so that it will correctly display the basket contents.) :whistle: Quote Link to comment Share on other sites More sharing options...
Guest idara Posted November 1, 2005 Share Posted November 1, 2005 Hi webpresentations Thanks ! nice usefull trick, looking forward for search results page too. Your Test Store don't have these modifications, or do you have someother example site to look at it ? it will be helpfull to see the working solution in your testsite (if you don't mind) Regards Yunus Quote Link to comment Share on other sites More sharing options...
Guest Posted November 7, 2005 Share Posted November 7, 2005 Have a look at:-- http://www.freetime1.co.uk/store/ http://www.outdoor-spirit.co.uk/store/ * Test store is woefully out of date.... must sort that Quote Link to comment Share on other sites More sharing options...
Guest overdrive Posted November 10, 2005 Share Posted November 10, 2005 Hey Webpresentations, nice designs. I have a question, on the freetime1 store, how did you change the thumbnails for the subCats to replace the little blue folder icons? Was it easy? Any info much appreciated. TC Quote Link to comment Share on other sites More sharing options...
markscarts Posted November 10, 2005 Share Posted November 10, 2005 I'm not Web Pres, but I'd say easy enough with a little javascript . . . Script in header: <script language="JavaScript" type="text/JavaScript"> <!-- Â function MM_swapImgRestore() { //v3.0 Â var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; Â } Â Â function MM_preloadImages() { //v3.0 Â var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); Â Â var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) Â Â if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} Â } Â Â function MM_findObj(n, d) { //v4.01 Â var p,i,x; Â if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { Â Â d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} Â if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; Â for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); Â if(!x && d.getElementById) x=d.getElementById(n); return x; Â } Â Â function MM_swapImage() { //v3.0 Â var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) Â Â if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} Â } //--> </script> Links in body: Â Â <table cellspacing="0" cellpadding="0" border="0"> Â Â Â <tr> Â Â Â <td><a href="index.php?act=viewCat&catId=2" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','skins/Freetime/styleImages/buttons/quicklink1_hover.jpg',1)"><img src="skins/Freetime/styleImages/buttons/quicklink1.jpg" alt="Camping & Backpacking" width="105" height="50" name="Image1" longdesc="http://www.outdoor-spirit.co.uk/store/index.php?act=viewCat&catId=2" border="0" /></a></td> Â Â Â <td><a href="index.php?act=viewCat&catId=4" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','skins/Freetime/styleImages/buttons/quicklink2_hover.jpg',1)"><img src="skins/Freetime/styleImages/buttons/quicklink2.jpg" alt="Climbing & Mountaineering" width="105" height="50" name="Image2" longdesc="http://www.outdoor-spirit.co.uk/store/index.php?act=viewCat&catId=4" border="0" /></a></td> Â Â Â <td><a href="index.php?act=viewCat&catId=5" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','skins/Freetime/styleImages/buttons/quicklink3_hover.jpg',1)"><img src="skins/Freetime/styleImages/buttons/quicklink3.jpg" alt="Skiiing & Snowsports" width="105" height="50" name="Image3" longdesc="http://www.outdoor-spirit.co.uk/store/index.php?act=viewCat&catId=5" border="0" /></a></td> Â Â Â <td><a href="index.php?act=viewCat&catId=6" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','skins/Freetime/styleImages/buttons/quicklink4_hover.jpg',1)"><img src="skins/Freetime/styleImages/buttons/quicklink4.jpg" alt="Walking & Rambling" width="105" height="50" name="Image4" longdesc="http://www.outdoor-spirit.co.uk/store/index.php?act=viewCat&catId=6" border="0" /></a></td> Â Â Â <td><a href="index.php?act=viewCat&catId=7" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','skins/Freetime/styleImages/buttons/quicklink5_hover.jpg',1)"><img src="skins/Freetime/styleImages/buttons/quicklink5.jpg" alt="Lightweight Trekking" width="105" height="50" name="Image5" longdesc="http://www.outdoor-spirit.co.uk/store/index.php?act=viewCat&catId=7" border="0" /></a></td> Â Â Â <td><a href="index.php?act=viewCat&catId=8" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','skins/Freetime/styleImages/buttons/quicklink6_hover.jpg',1)"><img src="skins/Freetime/styleImages/buttons/quicklink6.jpg" alt="Outdoor Accessories" width="105" height="50" name="Image6" longdesc="http://www.outdoor-spirit.co.uk/store/index.php?act=viewCat&catId=8" border="0" /></a></td> Â Â Â </tr> Â Â </table> Quote Link to comment Share on other sites More sharing options...
Guest overdrive Posted November 11, 2005 Share Posted November 11, 2005 Thank you markscarts for that. Though it's not the rollover nav links at the top of the page that I was asking about but the subCat boxes near the bottom of the pages which in the stock templates are represented by a blue folder icon. How are the images made individual in each category? Ta Quote Link to comment Share on other sites More sharing options...
markscarts Posted November 11, 2005 Share Posted November 11, 2005 In you ACP, when adding or editing a category, you have the opportunity to assign an image to the category "Blue folder" you are talking about is the equivalent of a "no Photo" graphic for categories that you haven't assigned a photo to :w00t: Quote Link to comment Share on other sites More sharing options...
Guest Posted November 11, 2005 Share Posted November 11, 2005 Couldn't have said it better my self ....... Quote Link to comment Share on other sites More sharing options...
Guest overdrive Posted November 11, 2005 Share Posted November 11, 2005 */* DOH! my apologies for not paying attention! Thanks dude. :D Quote Link to comment Share on other sites More sharing options...
Guest aikdo Posted November 11, 2005 Share Posted November 11, 2005 On A Slight adaption to this post has anyone found a way to have a cat image (for Cat Headers) and a cat image (for the sub cat image) as two diffrent images i noticed in the second website shown the background/header image changed was this just because you had made all the cat immages stay as the blue folder or have you acctualy found away around... Quote Link to comment Share on other sites More sharing options...
Guest Posted November 30, 2005 Share Posted November 30, 2005 My apologies for the lateness of the reply, I have been busy with various sites recently. The banner images on outdoor-spirit, are seperate from the category images. Outdoor spirit currently doesnt have any category images, hence the blue folder icons for the sub cats. To achieve a similar effect to Outdoor Spirit, create a series of banner images (one for each of the main categories, and also a generic 'store' banner image) in skins/your_template_name/styleTemplates/content/index.tpl just below the following code (at the very top of the file) <!-- BEGIN: index --> insert the following code <!-- BEGIN: banner_left --> <div style="height:198px; background-image:url({VAL_FILE_LINK}); background-repeat:no-repeat;" class="boxContent"></div> <!-- END: banner_left --> changing height:198px to the height of your banner image. you will also need the following code in includes/content/index.inc.php (insert above the 'Build Main Categories' section) $index->assign("VAL_FILE_LINK",$GLOBALS['rootRel']."skins/".$config['skinDir']."/styleImages/banners/brochure_store_left.jpg"); $index->parse("index.banner_left"); To deal with the category-specific banner images, in skins/your_template_name/styleTemplates/content/viewCat.tpl just below the first line of code, insert the following (again change the height value to the height of your banner image) <!-- BEGIN: banner_left --> <div style="height:198px; background-image:url({VAL_FILE_LINK}); background-repeat:no-repeat;" class="boxContent"></div> <!-- END: banner_left --> and then in includes/contentviewCat.php, above the 'Build Sub-Categories' section insert the following code: ////////////////////////////////// // BANNER IMAGE ////////////////////////////////// switch($_GET['catId']){ Â case 7: Â case 8: Â case 9: Â case 10: Â case 11: Â case 12: Â case 13: Â case 41: Â case 59: Â case 60: Â $imgLeft = 'category_footwear_left.jpg'; Â break; Â case 15: Â case 16: Â case 17: Â case 18: Â case 19: Â case 20: Â case 55: Â $imgLeft = 'category_clothing_left.jpg'; Â break; Â case 21: Â case 22: Â case 23: Â case 24: Â $imgLeft = 'category_camping_left.jpg'; Â break; Â case 25: Â case 26: Â case 27: Â case 28: Â case 29: Â case 30: Â case 50: Â $imgLeft = 'category_accessories_left.jpg'; Â break; Â case 31: Â case 32: Â case 33: Â case 34: Â case 35: Â case 36: Â $imgLeft = 'category_fishing_left.jpg'; Â break; Â case 37: Â case 38: Â case 39: Â case 42: Â case 56: Â case 57: Â $imgLeft = 'category_country_clothing_left.jpg'; Â break; Â case 43: Â $imgLeft = 'category_skiing_left.jpg'; Â break; Â case 44: Â $imgLeft = 'category_walking_left.jpg'; Â break; Â default: Â $imgLeft = 'brochure_store_left.jpg'; Â break; } $view_cat->assign("VAL_FILE_LINK",$GLOBALS['rootRel']."skins/".$config['skinDir']."/styleImages/banners/".$imgLeft); $view_cat->parse("view_cat.banner_left"); There we have it banner images across the categories, with a generic store as the default. **Note All the numbers in the switch statement relate to the category id for each of the categories in the store. This is found in the url for the category pages of the store, thus:- index.php?act=viewCat&catId=25. You will notice that some images have more than number (category id) listed against them, this is to deal with sub-catgeories. (I.E. if you have a main category of 'Footwear', which is further split down into say 'Mens', 'Womens' and 'Childrens' - with this setup, the 'Footwear' banner image will also appear on the pages for 'Mens' Womens' and 'Childrens') If you have a lot of categories you may end up with a huge select statement, one way to get around this (rightly pointed out Sir William in this post http://www.cubecart.com/site/forums/index....topic=12364&hl=) would be to set up an array containing the image file name, and category id. Quote Link to comment Share on other sites More sharing options...
markscarts Posted November 30, 2005 Share Posted November 30, 2005 Awesome info - bookmarked - thanx! ;) Quote Link to comment Share on other sites More sharing options...
Guest aikdo Posted November 30, 2005 Share Posted November 30, 2005 Same Here Just What i Wanted... Thankyou... Quote Link to comment Share on other sites More sharing options...
Guest overdrive Posted November 30, 2005 Share Posted November 30, 2005 Marvellous post! Cheers ;) Quote Link to comment Share on other sites More sharing options...
Guest Posted November 30, 2005 Share Posted November 30, 2005 Glad to be of service ;) Quote Link to comment Share on other sites More sharing options...
Guest sparrowdog Posted February 25, 2006 Share Posted February 25, 2006 I notice on the Freetime site listed in this topic, there is text information on the actual Category pages. How is this done? ie: on http://www.freetime1.co.uk/store/index.php...d=8&act=viewCat This is something that would help me immensely. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 27, 2006 Share Posted February 27, 2006 I notice on the Freetime site listed in this topic, there is text information on the actual Category pages. How is this done? ie: on http://www.freetime1.co.uk/store/index.php...d=8&act=viewCat This is something that would help me immensely. I used the Category Description mod, available here and here. (There is also a similar one on cubecart.org - costs $9.95) I'm not sure how different the pay for mod is from the other two. The free one I used on Freetime basically just adds a new field to the categories table, and an editor window to the add/edit admin screen for categories. In my opinion, this is a very useful mod. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.