Jump to content

markscarts

Member
  • Posts

    2,486
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by markscarts

  1. Always more than one way to skin the cat :D
  2. Sorry Sidney, I finally had some time to test this, and here is what you need to use: if(($_GET['catId']!=2) && ($_GET['catId']!=4)) { $view_cat->parse("view_cat.productTable.products.buy_btn"); } edited to correct the code This has been tested on my sample store, cubecart 3.0.15 and works. My foolish post above has been corrected
  3. Search skins & templates section and General section for: IE peekaboo bug
  4. @ devstudent: Don't be a dweeb. If you don't understand something, you might ask instead of posting nonsense. This forum has not been set in cement since it's founding, but is dynamic, it grows and it changes. If you see posts with people discussing mods and showing links, look at the date on the posts. There was a time that this was allowed. The archives here are full of great info on mods and links to sources, but folk won't know that who do not use search or who just joined last week. If you see posts that appear to be flaunting the rules and are of a recent date, use the ! Report this Post ! feature to bring it to the moderator's attention. Your help will be appreciated, while your wise-cracks and insinuations may not be. A word to the wise @ gazza: Sorry, I do not believe anyone has created an online, automatic skin generator for CubeCart.
  5. A simple hack will get it done. For the hack, one easy way is to use the category id as the name of your images. EXAMPLE: Let's say you want to display jpeg images in place of text for those category names. In that case, if you have a category named "Cats" with cat id of 1, and another category "Dogs" with a cat id of 2, and another category "Parrots" with a cat id of 3, then ~ Rename the image that goes in place of the text "Cats" to 1.jpg ~ Rename the image that goes in place of the text "Dogs" to 2.jpg ~ Rename the image that goes in place of the text "Parrots" to 3.jpg Now, place those images in a folder on your website, example: images/categoryNames/ Next, OPEN includes/content/viewCat.inc.php FIND this line: $view_cat->assign("TXT_CATEGORY", validHTML($subCategories[$i]['cat_name'])); REPLACE with this: //Start Mod Cat names replaced with images, MarksCarts CC3.biz - original line commented below and replaced //$view_cat->assign("TXT_CATEGORY", validHTML($subCategories[$i]['cat_name'])); if(file_exists($GLOBALS['rootDir']."/images/categoryNames/".$subCategories[$i]['cat_id'].".jpg")) { $view_cat->assign("TXT_CATEGORY", "<img src='images/categoryNames/".$subCategories[$i]['cat_id'].".jpg' border='0' alt='".$subCategories[$i]['cat_name']."' />"); } else { $view_cat->assign("TXT_CATEGORY", validHTML($subCategories[$i]['cat_name'])); } //End mod, Markscarts, CC3.biz The above hack will look into the folder images/categoryNames to see if an image exists for the category id. If the image exists, it will replace the text on category page. If no image exists, the text will appear as normal. Be careful to copy and paste this code, be very careful of the single quotes and double quotes in here. You can change the directory name from images/categoryNames/ to whatever directory you want to use to store the images in, be careful to change it in two places. You can change .jpg to a different extension like .gif or .png, be careful to change it in two places above.
  6. This is a phenomenon known as the IE peekaboo bug Try adding position: relative; to .txtContentTitle in styleSheets/style.css of your skin.
  7. ."&hellip;" Latest Prods: $index->assign("VAL_PRODUCT_NAME",substr(validHTML($latestProducts[$i]['name']),0,10)."…"); Popular Prods: $popularProds[$i]['name'] = substr(validHTML($popularProds[$i]['name']),0,10)."…"; EDIT: In the code above, use a period plus quotation marks to concatenate a text string to the end ."..." Rather than putting the three perids between the quotation marks, I use ."&hellip;" - When I put it above, the forum software turns it into the three dots when I post. For comparison, look at includes/content/viewCat.inc.php on line 254 where similar code is uesd.
  8. You are missing paretheses in the code I showed you, that's why I put them in red, to prevent missing one Also, the category numbers need to be changed to represent the categories you are dealing with. I used 19, 20, 21, 22 as examples only. Should be:
  9. Can't answer this without seeing the code, who could possibly know where your mistake is? For best results, give a link to the store when asking a question.
  10. There is a free modification for this. Type the following into google (without quote marks): " clone product with this tiny mod "
  11. Try this instead: if(($_GET['catId']!=2) && ($_GET['catId']!=4)) { $view_cat->parse("view_cat.productTable.products.buy_btn"); } edited to correct the code
  12. To limit number of characters in latest prods titles, open includes/content/index.inc.php Find the following line of code: $index->assign("VAL_PRODUCT_NAME",validHTML($latestProducts[$i]['name'])); Replace with this code: $index->assign("VAL_PRODUCT_NAME",substr(validHTML($latestProducts[$i]['name']),0,10)); Change the number 10 - this is the number that will set number of characters to show. To limit number of characters in popular prods titles, open includes/boxes/popularProducts.inc.php Find the following line of code: $popularProds[$i]['name'] = validHTML($popularProds[$i]['name']); Replace with this code: $popularProds[$i]['name'] = substr(validHTML($popularProds[$i]['name']),0,10); Change the number 10 - this is the number that will set number of characters to show.
  13. It is not a standard cubecart feature. It requires a mod. It has been asked and discussed a little over a year ago. The discussion took place in the "General" forum rather than skins. The mod was developed by Estelle. It is not possible to link to outside mods in this forum, so best bet is to find the old thread or google for "cubecart mods" and find Estelle's store.
  14. Just looked at your site. Anyway, I didn't see any tabs at all, just the background bar. The reason it looks crazy is because the bar and tabs are made with background images. If you want to change dimensions, I suggest you create new images in dimensions that fit better as well.
  15. LOL! Sorry for the "tease" it's just that giving links to this stuff outside the forum is prohibited; therefore, I send PMs with links for people at times. I can reproduce the entire instructions here: CATEGORIES ON HOMEPAGE! VERSION 1.2.0 • ACP ON/OFF SWITCH • COMPATIBLE WITH SORT ORDER MOD - By MarksCarts, CC3.biz +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ • FEATURES This mod allows you to show the store's top-level categories on the store's Homepage, like Latest Products. Also like Latest Products, you can set whether to show categories in your store's Admin Control Panel (ACP). Finally, for those who have installed Sir William's category sort order mod, this mod is compatible by changing one line of code. Your Homepage Cats will be sorted according to the order you set in Sir William's mod settings. • HISTORY This was a much requested modification in the past. A member named loua published a small hack for this in December 2005 in this thread: http://www.cubecart.com/site/forums/index....5&st=0& I began work on this mod in Nov/Dec 2005, but tabled publication when aikdo published a free working version at cubecart-skins.com. I am now offering my version of this mod as a free mod, since it has a few small features that the previous mods have lacked. • FILES AFFECTED admin/settings/index.php language/en/lang.inc.php includes/content/index.inc.php skins/{your_skin}/styleTemplates/content/index.tpl ******************************** 1. OPEN admin/settings/index.php ******************************** - FIND the following lines of code around line 230 (3.0.10): <tr> <td width="30%" class="tdText"><strong><?php echo $lang['admin']['settings']['show_latest'];?></strong></td> - PASTE the following block of code directly ABOVE them: <!-- Starting HomePage Categories - MarksCarts, CC3.biz --> <tr> <td width="30%" class="tdText"><strong><?php echo $lang['admin']['settings']['show_homepagecats'];?></strong></td> <td align="left"> <select class="textbox" name="config[showHomePageCats]"> <option value="0" <?php if($config['showHomePageCats']==0) echo "selected='selected'"; ?>><?php echo $lang['admin']['no'];?></option> <option value="1" <?php if($config['showHomePageCats']==1) echo "selected='selected'"; ?>><?php echo $lang['admin']['yes'];?></option> </select> </td> </tr> <!-- Ending HomePage Categories - MarksCarts, CC3.biz --> - SAVE, CLOSE and UPLOAD admin/settings/index.php ************************************ NOTE: Other Languages - If you are using languages other than English, translate the English statements in our code below, and paste the code into the appropriate language file. ************************************ ************************************ 2. OPEN language/en/lang.inc.php ************************************ - FIND the following line of code around line 894 (3.0.10): 'show_latest' => "Show Latest Products on homepage?", - PASTE the following two lines of code directly ABOVE it: /* Added for Homepage Categories - MarksCarts, CC3.biz */ 'show_homepagecats' => "Show Categories on homepage?", - SAVE, CLOSE and UPLOAD language/en/lang.inc.php ************************************** 3. OPEN includes/content/index.inc.php ************************************** - FIND the following line of code, near the end of the file: $index->parse("index"); - PASTE this large block of code ABOVE that line: ---------------------------------------------------- /* Starting HomePage Categories - MarksCarts, CC3.biz Following line modified for use with Sir William's Category & Product Sort Order. The first line below is commented (//) and the second line is active. If you have Sir William's sort order mod installed, you can remove the comment double-slashes from the first line below, and place them in front of the second line instead.*/ //$query = "SELECT * FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = ".$db->mySQLSafe($_GET['catId'])." ORDER BY disp_order ASC"; $query = "SELECT * FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = ".$db->mySQLSafe($_GET['catId'])." ORDER BY cat_name ASC"; $resultsForeign = $db->select("SELECT cat_master_id as cat_id, cat_name FROM ".$glob['dbprefix']."CubeCart_cats_lang WHERE cat_lang = '".$lang_folder."'"); $homePageCats = ""; $homePageCats = $db->select($query); if($config['showHomePageCats']==1 && $homePageCats==TRUE){ for ($i=0; $i<count($homePageCats); $i++){ if(is_array($resultsForeign)){ for ($k=0; $k<count($resultsForeign); $k++){ if($resultsForeign[$k]['cat_id'] == $homePageCats[$i]['cat_id']){ $homePageCats[$i]['cat_name'] = $resultsForeign[$k]['cat_name']; } } } if(empty($homePageCats[$i]['cat_image'])){ $index->assign("IMG_CATEGORY",$GLOBALS['rootRel']."skins/".$config['skinDir']."/styleImages/catnophoto.gif"); } else { $index->assign("IMG_CATEGORY",$GLOBALS['rootRel']."images/uploads/".$homePageCats[$i]['cat_image']); } $index->assign("TXT_LINK_CATID",$homePageCats[$i]['cat_id']); $index->assign("TXT_CATEGORY", validHTML($homePageCats[$i]['cat_name'])); $index->assign("NO_PRODUCTS", $homePageCats[$i]['noProducts']); $index->parse("index.homepage_cats.homepage_cats_loop"); } $index->parse("index.homepage_cats"); } /* Ending HomePage Categories - MarksCarts, CC3.biz */ ------------------------------------------------------------------ - SAVE, CLOSE and UPLOAD includes/content/index.inc.php ********************************************************* 4. OPEN skins/{your_skin}/styleTemplates/content/index.tpl ********************************************************* - FIND the following line of code: <!-- BEGIN: latest_prods --> - PASTE this block of code ABOVE that line: --------------------------------------------- <!-- Starting HomePage Categories - MarksCarts, CC3.biz --> <!-- BEGIN: homepage_cats --> <div class="boxContent"> <span class="txtContentTitle">Browse Our Categories</span> <div> <!-- BEGIN: homepage_cats_loop --> <div class="homeCats" style="float: left; text-align: center; position:relative; margin:5px;"> <a href="index.php?act=viewCat&amp;catId={TXT_LINK_CATID}" class="txtDefault"><img src="{IMG_CATEGORY}" alt="{TXT_CATEGORY}" border="0" title="{TXT_CATEGORY}" /></a><br /> <a href="index.php?act=viewCat&amp;catId={TXT_LINK_CATID}" class="txtDefault">{TXT_CATEGORY}</a> </div> <!-- END: homepage_cats_loop --> <br clear="all" /> </div> <br clear="all" /> </div> <!-- END: homepage_cats --> <!-- Ending HomePage Categories - MarksCarts, CC3.biz --> --------------------------------------------------------------------------- - SAVE, CLOSE and UPLOAD skins/{your_skin}/skinTemplates/content/index.tpl ********************************************************* 5. ACTIVATE HomePage Categories ********************************************************* Login to your store's Admin Control Panel. Go to: Store Config > General Settings > Styles & Misc > Show Categories on homepage? Set to "Yes" ********************************************************* 6. STYLES for HomePage Categories ********************************************************* Each store is different - different overall style, different skins, different sizes for category images, etc. This mod does not offer much styling for the categories. Your homepage will look best if all top-level categories have an image of the same size - generally fairly small. A class has been included in the template, "homeCats" So, if you are proficient with CSS you can add a .homeCats class to layout.css and use styles there to set widths, heights, etc. to make the Homepage Cats compliment your own site better. If you need help with styling the final look of your homepage cats . . . My name is Mark Gunter, and I am known as "MarksCarts" on the CubeCart™ forums. Please give me some feedback on the usefulness of this tutorial. ######################################################################### ######################################################################### SUPPORT - CONTACT - ETC. ######################################################################### ######################################################################### No support is offered on these free mods and tutorials, except as I am able to give. I have a very busy schedule, and like to help when I can, but I cannot afford to offer free support on free mods and tutorials.
  16. Hear, hear Nothing wrong with being an auto-didactic. My degree is in theology with a major in biblical languages - but what I really learned at university level was "how" to learn, and am wholly self-taught in matters of html and css, etc. Best books for me have been selections from the "Visual Quick-Start Guide" series from Peachpit Press. Elizabeth Castro's introductory texts on HTML and CSS were godsends when I picked them up a few years ago, and I have found that Larry Ullman's books from that series on PHP and MySQL are just fantastic as well. But, nothing beats just trying to read and experiment with actual code of a software like CubeCart along with trying to read the code of fellow modders. That's where the best lessons are learned BTW, for myself, the starting point was to ask a kid, who had just started his first semester in web development, "What texts do you use?" That's how I originally found Castro's book and became familiar with the clear-cut, hands-on approach of the Visual Quickstart Guide series. A golden nugget in what devstudent had to say is that you can waste time and money on the wrong texts. Ask around, then look over the books very well before you buy. I wasted some money on a big PHP text before seeking out Ullman's book which is tailored to the way I learn personally. To get the most out of those texts, go cover-to-cover and do all the hands-on coding exercises. Otherwise, you may as well be in class ignoring the lectures and refusing to do your homework.
  17. That type of discussion is taboo here, for good reason You are welcome to open a helpdesk ticket at my site to discuss this.
  18. And here is a more complete recipe for doing what you ask. It is copied fromm another post I answered a couple months ago regarding this. First, the global/index.tpl will be the basic cubecart equivalent of your html page. This template is a straightforward HTML page, with two notable exceptions, explained below. Open yours and study along. • Like any valid HTML or XHTML page, it starts with a DOCTYPE declaration. <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> • As with all HTML pages, the "code proper" begins and ends with the html tag: <html> . . . </html> <html xmlns="http://www.w3.org/1999/xhtml"> and at the bottom of the page </html> • The opening HTML tag is followed by a head section: <head> . . . </head> This section, like any normal html document, contains META tags and links to external scripts and stylesheets, etc. <head> <meta http-equiv="Content-Type" content="text/html; charset={VAL_ISO}" /> <title>{META_TITLE}</title> <meta name="description" content="{META_DESC}" /> <meta name="keywords" content="{META_KEYWORDS}" /> <link href="skins/{VAL_SKIN}/styleSheets/layout.css" rel="stylesheet" type="text/css" /> <link href="skins/{VAL_SKIN}/styleSheets/style.css" rel="stylesheet" type="text/css" /> <script language="javascript" src="js/jslibrary.js" type="text/javascript"></script> </head> • Following the head section comes the body section: <body> . . . </body> This section contains the code behind what you actually see on the webpage; i.e., the body of the webpage. It contains block-level tags or elements like <div> and <p> and <ul> and <form>, and line-level tags or elements like <span>, <strong>, <li>, etc. --------------------------------------- The page you create in your wysiwyg editor should contain all these elements! --------------------------------------- The two notable exceptions ~ First, note the <!-- BEGIN: special_name --> and <!-- END: special_name --> These look like any old html comments, but they are special markers for telling php where to parse active content from the php includes files. It is important to retain these markers, and to be sure they are in the correct file and in the right place. Certain content must remain between each specific set of markers, and certain content should be kept out from between these markers. Second, note the {SPECIAL_NAME} tags. These are content markers or variables that place php-generated content on the page, and in the global/index.tpl file they represent other .tpl files found in styleTemplates/boxes and styleTemplates/content. If you look at these other non-global .tpl files, you will see that they, too are html with the same two exceptions, but these files do not have doctype declarations, <html> tag, nor head nor body tags. These represent html snippets that are "pasted" into the body section of your xhtml document by use of the above mentioned {SPECIAL_NAME} tags. --------------------------------------- A basic understanding of the above is essential to doing what you wish to do, successfully. With that in mind, here is your general recipe: 1. Create your document using dreamweaver or some other creation program in the XHTML 1.0 format. 2. Copy and replace the doctype declaration and the <html> tag from stock cubecart skin text (recommended) 3. Place the <!-- BEGIN: body --> and <!-- END: body --> markers at beginning and end of page, respectively. 4. "Cut" the code snippets for boxes out of your created page and paste them into the correct styleTemplates/boxes .tpl files. • NOTE: You must re-code these snippets for active content using the php cues in each file appropriately, analogous to the original files ~ 5. Use the correct {SPECIAL_NAME} tags in place of the snippets you cut for pasting in the other files. 6. Likewise, "cut" the main content code and place it in styleTemplates/content/index.tpl, and again you must re-code this snippet for active content using the php cues appropriately, analogous to the original styleTemplates/content/index.tpl -------------------------------------- All of this can be a piece of cake if you are very familiar with coding, or it could be like a difficult birthing for the novice, but in any case it represents work. -------------------------------------- I hope this overview has been helpful; any feedback is appreciated. :w00t:
  19. You'll find the CubeCart code makes more sense than most. What you will need you will find in the skins folder. In there, you find all folders for the skin design. You will note the css files easily enough. Most store pages are built on global/index.tpl and the rest are built on global/cart.tpl. I am going to PM a link to a tutorial that might help with the {CAPITAL_NAMES} in curly cues that you find in the templates. :huh:
  20. One of the objectives I think in CubeCart development is to create the cart in clean, structured code that makes sense, with an eye toward integrity of structure between components, and the potential for clean, valid code in the output. In general, wysiwyg editors tend to make quite a mess of coding. This is one reason they might be undesireable to many of those who design with CubeCart, thus you read the designers writing about CSS and HTML as if they can actually write it for themselves. Since CubeCart depends on php driving what is called an XTemplate engine to produce dynamic XHTML, using data from a mySQL database, presently, you can't simply open the storefront in a wysiwyg editor. If you have no knowledge of html and css and feel you have no choice but to use a wysiwyg editor, there are some tricks you can use . . . Like opening your store in a browser, and saving it as a webpage. This will give it to you in an html format that you can open in a wysiwyg editor. However, once your designing is done, you or someone will still need to dissect the code and break it back into the correct XTemplate sections used by CubeCart, otherwise you will not be able to have the dynamic features like product lists, random imaging, etc. etc. etc. Hope that helps somehow, not sure how useful it mighht actually be to you. Mark
  21. Yes, of course the images will be distorted. For this reason I would not do it, and I very rarely use browser resizing of images in my web development. This is only an answer to the question, and will work if the images are not too badly distorted. This will depend upon just how reasonable you are in altering the original size :)
  22. You do not need to create a field in the db for info in config settings, you simply code what you need into admin/settings/index.php rather than admin/index.php In your example: If you want a light switch to set on or off, just copy the code for any other switches you see there, and create your new one by analogy that way. For instance, Latest Products can be switched on or off, so you can copy the code related to that "switch" and by analogy create a new one. Put new unique names/tags where called for. That's it. Your info will be stored in config file along with everything else on that page, and you can use it like this: $config['switchName']==1 or $config['switchName']==0 You are better to code a switchName with value of either 1 or 0 on select, rather than a 'switchOff' vs. 'swichOn' and I would advise reading and learning from Al's existing code than trying to create your own from scratch for something this simple. Hope this helps :)
  23. Adjust the width down on .boxContent
×
×
  • Create New...