Hi there,
I need some instruction/coding help.
I would like to put my two product category pictures on the home page (in the place of the Latest Products pics).
I only have two categories (Classic and Chic) and want users to select one or the other, then view the products in that category.
I am thinking my home.tpl has to be modified in include the category instructions, but am not sure how.
http://www.chuneicarriers.com/shopping.html
You are correct. Just chop out the code displaying the latest products (shown below)
and put in your own html code to show the category images and info that you want.
You could also cut out the code (shown below) in catalog\controller\home.php that gets the latest products info and adds the data to the template. Just to save some unnecessary processing
Code: Select all
<div class="heading"><?php echo $text_latest; ?></div>
<?php foreach ($products as $product) { ?>
<div class="products"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a><br /><b><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></b><br /><?php echo $product['price']; ?></div>
<?php } ?>
You could also cut out the code (shown below) in catalog\controller\home.php that gets the latest products info and adds the data to the template. Just to save some unnecessary processing
Code: Select all
$product_data = array();
$results = $database->getRows("select * from product p left join product_description pd on (p.product_id = pd.product_id) left join image i on (p.image_id = i.image_id) where p.status = '1' and pd.language_id = '" . (int)$language->getId() . "' and p.date_available < now() and p.status = '1' order by p.date_added limit 6");
foreach ($results as $result) {
$product_data[] = array(
'name' => $result['name'],
'href' => $url->href('product', FALSE, array('product_id' => $result['product_id'])),
'thumb' => $image->resize($result['filename'], $config->get('config_image_width'), $config->get('config_image_height')),
// 'price' => $currency->format($tax->calculate($result['price'], $result['tax_class_id']))
'price' => $currency->format($tax->calculate($result['price'], $result['tax_class_id'], false))
);
}
$view->set('products', $product_data);
Something like the following, where 19 is the category id in the database.
Code: Select all
<a href="http://localhost/store/index.php?controller=category&path=19">Category 1</a>
Who is online
Users browsing this forum: No registered users and 6 guests