Docstoc

Zen Cart Category Side Box as Unordered List

Document Sample
Zen Cart Category Side Box as Unordered List Powered By Docstoc
					       Published on RizSilverthorn.net (http://www.rizsilverthorn.net)




By Fred
Created 17/03/2009 - 13:14



Zen Cart

Zen Cart is a very popular shopping cart system forked from oscommerce. While the Zen Cart homepage claims
that it is easy to install, configure and use, sometimes the method of changing options and features can be a little
confusing. Whatever you do, don't get me started on their theming - it's not pretty.
I am collecting various hints, tips and guides on how to do certain tasks as I come across them to bring them all
under one roof. Some come from the Zen Cart support forums [1], some from various websites, and the rest from
my own sometimes painful process of elimination.
If I have found the required information in either the Zen Cart forums or on another website, I have and will give full
attribution and link to the original article.
  Average: 0




Your rating: None




Category Side Box as Unordered List

For some unknown reason the creators of Zen Cart chose to not use an unordered list for the categories sidebox.
Save the attached file as includes/templates/<current template>/sideboxes/tpl_categories.php (Note: link is now
working again) and you'll have your sensible unordered list!
Once that is done go to admin -> Layout Settings and delete the entry in:


Categories Separator between the Category Name and Sub Categories


Finally, add something like the css code below to tidy up the display:


/* Categories sidebox */
#categoriesContent ul {
  list-style-image:none;
  list-style-position:outside;
  list-style-type:none;
  margin:0 0 0 10px;
  padding:0;
}

#categoriesContent ul li {
  margin: 3px 0 0 0;
  padding: 0;
}

/*#categories #categoriesContent a:hover, #categories .category-subs-selected {*/
#navColumnOne a:hover, #navColumnTwo a:hover, #categories .category-subs-selected {



                                                                                                        Page 1 of 6
       Published on RizSilverthorn.net (http://www.rizsilverthorn.net)

color: #CC0000;
}

#categories .category-subs-parent {
color: #265780;
}




This will remove the list marker, tighten up the indentation and colour the main and sub-headings when seleted.

I cannot remember where I got the tpl_categories.php file from - but I will link to the source as soon as I can find it.


Attachment                                                  Size


tpl_categories.php_.txt [2]                                 5.78 KB




Image Handler2


Image Handler 2 is a great addition to any Zen Cart install. Gone are the rather naïve, really old school "resized by
the browser from much bigger images" images. instead, sensible, correctly proportioned and re-sized images are
put in place.

However, when using SSL on a Zen Cart install in a sub-folder, the Image Handler2 Manager tends to fall apart a
little. No images are shown. After some digging around and copious use of Firebug (thanks to the people who
came up with that!) I figured out that Image Handler2 was not getting the correct URL to the images. As a
temporary measure, until I can come up with a better way to handle this, do the following:

change:


echo [3] zen_image(DIR_WS_CATALOG . $preview_image, addslashes [4]($products_name),
$width, $height) . '<br />';



to:


echo [3] zen_image('/your/subdirectory/'. DIR_WS_CATALOG . $preview_image, addslashes
[4]($products_name), $width, $height) . '<br />';




on lines 789, 799, 814

change:


zen_image($selected_image_file, addslashes [4]($products_name), $width, $height)


                                                                                                             Page 2 of 6
       Published on RizSilverthorn.net (http://www.rizsilverthorn.net)




to:


zen_image('/your/subdirectory'. $selected_image_file, addslashes [4]($products_name),
$width, $height)




on line 857.

Of course, this is not very portable and is prone to being over-written when upgrading. However, until the Image
Handler2 authors come up withh an alternative, at least this will get you going!




Quick and Simple Tips


The code design of Zen Cart is sometimes baffling, sometimes plain ugly and other times just plain WTF?! Even
the most seemingly obvious task takes longer as there is no central location for themeing and for something that
touts itself as "not for programmers", there is a hell of a lot of editing of obscure code files scattered throught the
installation.

Here I have tried to note down some of the more common, or at least common to me, items I need to keep track of.




Changing Meta Tags


To change the meta tags (including the title) edit the file at:




/includes/languages/english/meta-tags.php




Changing the Heading Title


Like most settings, the default header text "Congratulations! You have successfully installed your Zen Cart™
E-Commerce Solution." is in more than one location, although this time it is in the same file. Copy
/includes/languages/english/index.php to /includes/languages/english/<your template>/index.php and edit lines 53
& 57.


                                                                                                              Page 3 of 6
       Published on RizSilverthorn.net (http://www.rizsilverthorn.net)




Displaying Stock Quantities


Although you might think that the following locations under admin -> configuration set the display of stock
quantities, you'd be wrong:




product listing -> Display Product Quantity
new listing -> Display Product Quantity
featured listing -> Display Product Quantity
all listing -> Display Product Quantity

Not quite sure what the above actually affect yet (they must affect something, surely!) Go to admin -> catalog ->
product types -> product general and change the setting for:




Show Quantity in Stock




Hiding "No Image Available" image


This is a simple one - go to admin -> Comfiguration -> Images. Set the following:




Product Image - No Image Status: 0




Products priced by attributes


Sometimes you may need to add products which have no base price, but are priced by their attributes (e.g.
takeaway dishes priced by the main ingredient). To do so, go to admin -> Catelog -> Categories/Products ->
new product. Set the following:




Product Priced by Attributes: Yes
Product Price: 0.00


                                                                                                        Page 4 of 6
       Published on RizSilverthorn.net (http://www.rizsilverthorn.net)




Then under admin -> Catelog -> Attribute Controller delete the + symbol, and enter the price. The system will
show the product with a Starting From price and a selectable list of choices.




Removing Add to Cart links from Product Listing


Depending on the site and client, you may wish to remove the Add to Cart links from the product lists when
browsing categories. You need to make two changes in admin -> Configuration -> Product Listing:




Display Product Add to Cart Button: 0
Display Multiple Products Qty Box Status and Set Button Location: 0




Removing the IP Address


To disable the IP address of the visitor from the bottom of the page, go to admin -> Configuration -> Layout
Settings and set the following:




Footer - Show IP Address status: 0




Terra Network Zen Cart Hosting

When your Zen Cart is hosted on TerraNetworks, there a few of differences between the default Zen Cart
installation and the Terra Network setup which threw me off a couple of times.


Administration Login

There is no admin folder - use stockroom instead




    Web Dev
    MySQL
    PHP
    Software


                                                                                                       Page 5 of 6
       Published on RizSilverthorn.net (http://www.rizsilverthorn.net)

    Zen Cart
    Work


Source URL: http://www.rizsilverthorn.net/content/zen-cart

Links:
[1] http://www.zen-cart.com/forum
[2] http://www.rizsilverthorn.net/sites/default/files/tpl_categories.php_.txt
[3] http://www.php.net/echo
[4] http://www.php.net/addslashes




                                                                                Page 6 of 6

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:1820
posted:2/15/2011
language:English
pages:6