jayii
(Jaya777ram)
September 12, 2011, 6:25am
1
In my front end ,i have viewed all categories like motorola,samsung,nokia… from category table ,in next page i have viewed corresponding products,i.e.,if i click motorola ,all mobiles of motorola will display from product table.Now my doubt is that,if i click a motorola product,user should view all details of that product(details are in product,design and features table).how it can be acheived dynamically.
perochak
(Amjad Mughal)
September 12, 2011, 12:04pm
2
Is it not simple.
Just use the product id or the PK of the products table and get all the associated data i.e. features, images etc from the respective tables.
jayii
(Jaya777ram)
September 13, 2011, 6:02am
3
i understand pero !!! not exact !! its simple but am complicating i think…
i have acheived index.php?r=category/ , index.php?r=category/viewproduct&id=1 ,now i have to do index.php?r=category/viewProductdetails&id=1 .
when i display Product names of category id:1 by using for each and add chtml link to product names,
url link shows index.php?r=category/viewproduct&id=1# for all product names?? ,how to change it ? . I have given
product names of category id:1-Nokia as eg: pd_id:1-N72,pd_id:2-N73,pd_id:3-N80
jayii
(Jaya777ram)
September 19, 2011, 5:24am
5
<?php
$por= product::model()->findAllByAttributes(array('cat_id'=>$_GET['cat_id']));
$list = CHtml::listData($por,
'pd_id','pd_id');
foreach($list as $value)
{
echo CHtml::link($value,array('showproduct','id'=>$value)); }
the above code,does
when user clicks a product id,the particular product’s details are shown.
i want,user should click product name to show the product’s details !!
perochak
(Amjad Mughal)
September 19, 2011, 1:31pm
6
You should change it
$list = CHtml::listData($por,
'pd_id','pd_name');
And then use as
foreach($list as $id=>$name)
{
echo CHtml::link($name,array('showproduct','id'=>$id)); }
P.N.
I have used pd_name for name, please change it with your product’s table for name of product name column.
Thanks
jayii
(Jaya777ram)
September 20, 2011, 6:53am
7
you taught me a good work today.very thanks.
now am doing, Add to Cart concept.
support till earth exists.