I've set up a fairly nice website in just a few hours containing a webshop
HTTP://www.4yourdog.nl
I have a question though. In the productlist, only the "product name" links to the "product-detail-TAB."
I would like the product name, description and product image to link to the same product detail tab.
I've tried a million things inside the PHP script, but I can't seem to get things right.
Below the code which builds the link for "PRODNAME" but doesn't build it for "PRODDESC" and "IMG"
Thanx for any help in advance,
Matthijs
Code: Select all
$rowclass = 'row1';
$entryarray = array();
while ($dbresult && $row = $dbresult->FetchRow())
{
$onerow = new stdClass();
$onerow->prodid = $row['product_id'];
$onerow->prodname = $this->CreateLink($id, 'fe_product_detail', $returnid, $row['prodname'], array('product_id'=>$row['product_id']));
$onerow->proddesc = $row['proddesc'];
// Prepare price, if no price state 'Sold out'
if ($row['price'] != 0) {
$onerow->price = $row['price'];
}
else {
$onerow->price = $this->Lang('productsoldout');
}
// Build link to cart
if ($cartMSInstalled) {
$onerow->addproduct = $cmsmodules[$modulename]['object']->CreateLink( $id, 'cart', $returnid, $this->Lang('addtocart'),
array ('name'=>$row['name'],
'perfaction' => 'add_product',
'product_id' => $row['product_id'],
'qty' => 1,
'returnmod' => 'ShopMadeSimple'
));
}
// Get the first picture available for the product found
$query = "SELECT * FROM ".cms_db_prefix()."module_sms_product_images WHERE product_id = ?";
$picture = $db->GetRow($query, array($row['product_id']));
if ($picture)
{
if (isset($picture['image']) && $picture['image'] != 'no_image.jpg'&& $picture['image'] != '') {
$onerow->prodimage = $pathproduct.$picture['image'];
}
else {
$this->smarty->assign('prodimage', '*none');
}
}
$onerow->rowclass = $rowclass;
$entryarray[] = $onerow;
($rowclass=="row1"?$rowclass="row2":$rowclass="row1");
}
$this->smarty->assign_by_ref('products', $entryarray);
$this->smarty->assign('lable_product_count', $this->Lang('textproductcount', count($entryarray)));