Saturday, 23 October 2010

How do I add javascript to specific page headers?

These files are defined under...

modules/pages/PAGETYPE/jscript_main.php

eg the javascript for the product info page is saved at

modules/pages/product_info/jscript_main.php

How do I add a second stylesheet?

The header elements are created under /yourtemplate/common/html_header.php

It works by adding any css file named "style*.css" under your template's css folder to the page head, or you can hard code the link here.

How do I link to the shopping cart?

Use the zen_href_link function as follows...

<a href="'.zen_href_link(FILENAME_SHOPPING_CART).'">

How to I change the "ea." in the shopping cart?

This is generated by a variable called BOX_SHOPPING_CART_DIVIDER.

This is set in includes/languages/english.php

Friday, 22 October 2010

How do I upload multiple images?

1. Name your images NAMEOFIMAGE.jpg, NAMEOFIMAGE_01.jpg, NAMEOFIMAGE_02.jpg
with the ones with numbers as the sub images.

2. Upload a numbered one when you create your product.

3. Edit the product, and select another numbered item to upload.

4. When all numbered items are uploaded, upload the original NAMEOFIMAGE.jpg one.

Tuesday, 19 October 2010

How do I move the product attributes above the buy button?

The file templates/*yourtemplate*/templates/tpl/products/info_display.php

has comment tags showing where each section begins and ends, so simply move the bit which starts

<!--bof Attributes Module -->

and ends

<!--eof Attributes Module -->

above the

<!--bof Add to Cart Box -->

section.

Monday, 18 October 2010

How do I disable products appearing as "sold out"?

These settings are under configuration - stock.

If a product is manually set to out of stock on the product page, it will simply vanish from the site.

where is the sold out button generated in zen cart?

includes/functions/functions_general.php

How do I replace the "... more info" text.

This is under includes/languages/english.php

The line you want is...

// more info in place of buy now
define('MORE_INFO_TEXT','...more info');

Which file creates the "featured products" section?

this is saved here...
includes/modules/featured_products.php

the prices are pulled out here...
includes/functions/functions_prices.php

Saturday, 16 October 2010

How do I insert a category image using the zen_image() function

<?php
$categories_image = zen_get_categories_image(1);
echo zen_image(DIR_WS_IMAGES . $categories_image, $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT);

?>



changing the '1' in zen_get_categories_image(1) to the category id

How do I reference the row or column of a category in the category list, with css.

The category list is generated in the file includes/modules/category_row.php

If you change the line starting $list_box_contents[$row][$col] to

$list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . '', 'text' => '<div class="categorybox colbox'.$col.' rowbox'.$row.'"><a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '"><span class="categoryimage">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</span><span class="categorynamex">' . $categories->fields['categories_name'] . '</span></a></div>');

Then this provides new classes to reference -
categorybox = the image and title
categoryimage = the image
categorynamex = the title

It also provides two classes which change depending on the row or column you are in.

colbox0 is applied to the category of every first column element,
colbox1 is applied to the second etc.

rowbox0, rowbox1... is the same, but with the rows.

Where do I add new colours to the colours attribute?

Under catalogue - attributes controller.

Select Values, and under that you can select the "colours" option name and enter a new one.

Friday, 15 October 2010

Where do I update the main product image size?

Under configuration - images.

This sets a maximum image size, but smaller images can be uploaded.

How do I make the product page pull out a full size image, rather than a popup?

In your templates folder, under "templates", there is a file called tpl_modules_main_product_image.php.

Change this bit...

<script language="javascript" type="text/javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
//--></script>

to...

<?php echo zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT); ?>

How do I turn off tell-a-friend?

This is under catalog - product types.

Select 'edit layout'. It is one of the options on this page.

How do I add a class to the input box on the search sidebox?

in the file...
includes/templates/yourtemplate/sideboxes/tpl_search.php

change...

$content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: '

to..

$content .= zen_draw_input_field('keyword', '', 'size="18" class="searchinput" maxlength="100" style="width: '

How do I remove the advanced search option from the side box?

This code is in the file indludes/templates/yourtemplate/sideboxes/tpl_search.php

$content .= '<br /><a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';

This can just be deleted, or commented out.

How do I style the subcategories in the categories sidebox.

These have the class name ".category-products", so you can add css to that.

It can make for tidier code to remove the normal html indents (configuration - layout settings) and use css instead.

How do I make the categories box into a list, rather than links with line breaks

Edit the file - yourtemplate / sideboxes / tpl_categoires.php

in such a way that mentions of <a> tags are replaced by <li><a>
and <br> tags are replaced by <\li>

You then need to add
$content .= '<ul>';
before the for loop

and
$content .= '</ul>';
after the loop