Need module output in table format
18 posts
• Page 1 of 1
Need module output in table format
Hi to all,
i am new to opencart but it feel me good while using opencart. its great open source platform.
i am trying to use latest post module to give out put in tabular format like
model1 model2 model3 model4
model5 model6 model7 model8
model9 model10 model11 model12
.........................
with model number to display only no other information need to display.
any help wud be appricated.
Dharam
i am new to opencart but it feel me good while using opencart. its great open source platform.
i am trying to use latest post module to give out put in tabular format like
model1 model2 model3 model4
model5 model6 model7 model8
model9 model10 model11 model12
.........................
with model number to display only no other information need to display.
any help wud be appricated.
Dharam
- dharam81
- Posts: 40
- Joined: Mon Apr 30, 2012 12:26 pm
Re: Need module output in table format
The controller catalog/controller/module/latest.php does not use the field 'model'.
You need to modify the controller.
At line 50 starts:
Change into:
The template catalog/view/theme/default/template/module/latest.tpl can be adjusted to display only the model with link.
Open the templatefile and replace:
with:
In this form it shows 4 colums ( each 23% ).
You need to modify the controller.
At line 50 starts:
- Code: Select all
$this->data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'price' => $price,
'special' => $special,
'rating' => $rating,
'reviews' => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']),
);
Change into:
- Code: Select all
$this->data['products'][] = array(
'product_id' => $result['product_id'],
'model' => $result['model'],
'thumb' => $image,
'name' => $result['name'],
'price' => $price,
'special' => $special,
'rating' => $rating,
'reviews' => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']),
);
The template catalog/view/theme/default/template/module/latest.tpl can be adjusted to display only the model with link.
Open the templatefile and replace:
- Code: Select all
<?php foreach ($products as $product) { ?>
<div>
<?php if ($product['thumb']) { ?>
<div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
<?php } ?>
<div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
<?php if ($product['price']) { ?>
<div class="price">
<?php if (!$product['special']) { ?>
<?php echo $product['price']; ?>
<?php } else { ?>
<span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
<?php } ?>
</div>
<?php } ?>
<?php if ($product['rating']) { ?>
<div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
<?php } ?>
<div class="cart"><input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" /></div>
</div>
<?php } ?>
with:
- Code: Select all
<?php foreach ($products as $product) { ?>
<div style="width: 23%; float: left; padding: 2px;">
<a href="<?php echo $product['href']; ?>"><?php echo $product['model']; ?></a>
</div>
<?php } ?>
In this form it shows 4 colums ( each 23% ).
-

pprmkr - Posts: 753
- Joined: Sat Jan 08, 2011 3:05 pm
Re: Need module output in table format
Hi pprmkr,
i made the required changed but not getting output display correctly.
below is screenshot for my website home page.
any help appreciated.
Cheers
i made the required changed but not getting output display correctly.
below is screenshot for my website home page.
any help appreciated.
Cheers
- Attachments
-
- home page after changes
- chek here.JPG (11.32 KiB) Viewed 2151 times
- dharam81
- Posts: 40
- Joined: Mon Apr 30, 2012 12:26 pm
Re: Need module output in table format
Hi pprmkr,
i managed to get list.
but i am using same code for two module and its getting messed up at home page.
below is home page attached.
can u tell me reason for this?
module 2
i managed to get list.
but i am using same code for two module and its getting messed up at home page.
below is home page attached.
can u tell me reason for this?
- Code: Select all
<div class="box">
<div class="box-heading">Latest Released Exams</div>
<div class="box-content">
<div class="box-product">
<?php foreach ($products as $product) { ?>
<div style="width: 10%; float: left; padding: 1px;">
<a href="<?php echo $product['href']; ?>"><?php echo $product['model']; ?></a>
</div>
<?php } ?>
</div>
</div>
</div>
module 2
- Code: Select all
<div class="box">
<div class="box-heading">Latest Updated Exams</div>
<div class="box-content">
<div class="box-product">
<?php foreach ($products as $product) { ?>
<div style="width: 10%; float: left; padding: 1px;">
<a href="<?php echo $product['href']; ?>"><?php echo $product['model']; ?></a>
</div>
<?php } ?>
</div>
</div>
</div>
- Attachments
-
- messed up.JPG (98.4 KiB) Viewed 2141 times
- dharam81
- Posts: 40
- Joined: Mon Apr 30, 2012 12:26 pm
Re: Need module output in table format
The div's are higher than the available space.
Make more space by adding:
just after:
Make more space by adding:
- Code: Select all
<br style="clear: both;" />
just after:
- Code: Select all
<?php } ?>
-

pprmkr - Posts: 753
- Joined: Sat Jan 08, 2011 3:05 pm
Re: Need module output in table format
worked like charm.
salute to pprmkr.
one more question.
where to change colour to content to black?
salute to pprmkr.
one more question.
where to change colour to content to black?
- dharam81
- Posts: 40
- Joined: Mon Apr 30, 2012 12:26 pm
Re: Need module output in table format
dharam81 wrote:where to change colour to content to black?
Fisrt you have to know:
- version of OpenCart ?
- the theme you use ?
- black background for all content, container or boxes only ?
When you post an url to your site, I can guide you ...
-

pprmkr - Posts: 753
- Joined: Sat Jan 08, 2011 3:05 pm
Re: Need module output in table format
guide4pass.com (not live still in develment)
in last discussion we got out put in table in want to change table content in black instead of green.Also if i can have green border for tabular out put.
i m using latest version of opncart 1.5.2
i am using custom theme.
in last discussion we got out put in table in want to change table content in black instead of green.Also if i can have green border for tabular out put.
i m using latest version of opncart 1.5.2
i am using custom theme.
- dharam81
- Posts: 40
- Joined: Mon Apr 30, 2012 12:26 pm
Re: Need module output in table format
To change the background of the box-content:
Try following steps.
Open catalog/view/theme/flanacart/stylesheet/stylesheet.css
At line 741:
Change into:
Try following steps.
Open catalog/view/theme/flanacart/stylesheet/stylesheet.css
At line 741:
- Code: Select all
.box .box-content {
padding: 0px;
}
Change into:
- Code: Select all
.box .box-content {
background: #000000;
border: 1px solid #81C93A;
padding: 5px;
}
-

pprmkr - Posts: 753
- Joined: Sat Jan 08, 2011 3:05 pm
Re: Need module output in table format
Hello Sir,
i changed to style sheet as per given details but it didnt work.
any help?
Regards
i changed to style sheet as per given details but it didnt work.
any help?
Regards
- dharam81
- Posts: 40
- Joined: Mon Apr 30, 2012 12:26 pm
Re: Need module output in table format
Please refresh ( F5 ), then the changes in the stylesheet will take effect.
-

pprmkr - Posts: 753
- Joined: Sat Jan 08, 2011 3:05 pm
Re: Need module output in table format
thanks pprmkr.
but actually i didnt mean that output.
i want to make change colour for my content to black and want to let heading remain green.
have a look on green font colour in attachement i want to change this colour.
thanka in advance.
dk
but actually i didnt mean that output.
i want to make change colour for my content to black and want to let heading remain green.
have a look on green font colour in attachement i want to change this colour.
thanka in advance.
dk
- Attachments
-
- attached.JPG (49.14 KiB) Viewed 2098 times
- dharam81
- Posts: 40
- Joined: Mon Apr 30, 2012 12:26 pm
Re: Need module output in table format
Sorry for the misunderstanding.
In that case you should change the color of the links.
In the stylesheet on line 36:
Change into:
Also add the color of the link in the welcome message on line 307 :
Change into:
In that case you should change the color of the links.
In the stylesheet on line 36:
- Code: Select all
a, a:visited, a b {
color: #81C93A;
text-decoration: underline;
cursor: pointer;
}
Change into:
- Code: Select all
a, a:visited, a b {
color: #000000;
text-decoration: underline;
cursor: pointer;
}
Also add the color of the link in the welcome message on line 307 :
- Code: Select all
#header #welcome a {
text-decoration: none;
}
Change into:
- Code: Select all
#header #welcome a {
color: #81C93A;
text-decoration: none;
}
-

pprmkr - Posts: 753
- Joined: Sat Jan 08, 2011 3:05 pm
Re: Need module output in table format
thanks pprmkr.
solved now.
once more request.
how to change background to white for the attached image.
regards
solved now.
once more request.
how to change background to white for the attached image.
regards
- Attachments
-
- mostview.png (11.92 KiB) Viewed 2091 times
- dharam81
- Posts: 40
- Joined: Mon Apr 30, 2012 12:26 pm
Re: Need module output in table format
To change the background of the box_content left and right, open the stylesheet and at line 745:
Change into:
- Code: Select all
#column-left .box .box-content, #column-right .box .box-content {
padding: 5px;
}
Change into:
- Code: Select all
#column-left .box .box-content, #column-right .box .box-content {
background: #ffffff;
padding: 5px;
}
-

pprmkr - Posts: 753
- Joined: Sat Jan 08, 2011 3:05 pm
Re: Need module output in table format
hi, can anybody help me.??
I also want to modify the latest.tpl, delete "wishlist" and "compare" button..
but now i'm facing a problem, latest product module won't show image of the product itself..
latest.php
latest.tpl
i've tried to add ['product_id'], but still it can't show the image product..
page source:
how to fix this.??
I also want to modify the latest.tpl, delete "wishlist" and "compare" button..
but now i'm facing a problem, latest product module won't show image of the product itself..
latest.php
- Code: Select all
$this->data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'description' => mb_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
'price' => $price,
'special' => $special,
'rating' => $rating,
'reviews' => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']),
latest.tpl
- Code: Select all
<?php foreach ($products as $product) { ?>
<div class="prod_hold">
<?php if ($product['thumb']) { ?>
<a class="wrap_link" href="<?php echo $product['href']; ?>"><img src="<?php echo $products['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a>
i've tried to add ['product_id'], but still it can't show the image product..
- Code: Select all
<?php foreach ($products as $product) { ?>
<div class="prod_hold">
<?php if ($product['thumb']) { ?>
<a class="wrap_link" href="<?php echo $products['product_id']['href']; ?>"><img src="<?php echo $products['product_id']['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a>
<?php } ?>
page source:
<h2 class="heading-title"><span>Latest</span></h2>
<div class="box-content">
<div class="box-product fixed">
<div class="prod_hold">
<a class="wrap_link" href="http://tulip-craft.com/index.php?route=product/product&product_id=70"><img src="<b>Notice</b>: Undefined index: thumb in <b>/home/k0238696/public_html/catalog/view/theme/tulipcraft/template/module/latest.tpl</b> on line <b>15</b>" alt="KP 02" /></a>
<div class="pricetag_small"><span class="price">Rp10,000,-</span></div>
<div class="info">
<h3>KP 02</h3>
<p>
how to fix this.??
All about Crochet and Knitting, a Handicraft Store -> http://tulip-craft.com
-

tulip_craft - Posts: 85
- Joined: Tue Dec 04, 2012 9:54 am
Re: Need module output in table format
In the template it's not:
It's the loop foreach products as product, so change into
- Code: Select all
<?php echo $products['thumb']; ?>
It's the loop foreach products as product, so change into
- Code: Select all
<?php echo $product['thumb']; ?>
-

pprmkr - Posts: 753
- Joined: Sat Jan 08, 2011 3:05 pm
Re: Need module output in table format
solved.. thanks anyway.!!
change to:
Code: Select all
- Code: Select all
<a class="wrap_link" href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" />
change to:
Code: Select all
- Code: Select all
<a class="wrap_link" href="<?php echo $product['href']; ?>"><span class="image"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" />
All about Crochet and Knitting, a Handicraft Store -> http://tulip-craft.com
-

tulip_craft - Posts: 85
- Joined: Tue Dec 04, 2012 9:54 am
18 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests














