Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
i2paq,
I think it would be the same but you enter the code into
catalog/controller/product/category.php
and
catalog/view/theme/default/template/product/category.tpl
but im no coding expert so backup if your gonna try it
Id try it but got to rush out now
Helen
Nope, I'm getting:helenmarie wrote:Thank you Q, thats awesome!
i2paq,
I think it would be the same but you enter the code into
catalog/controller/product/category.php
and
catalog/view/theme/default/template/product/category.tpl
but im no coding expert so backup if your gonna try it
Id try it but got to rush out now
Helen
Code: Select all
Notice: Undefined index: description in /var/www/vhosts/oc-directory.info/subdomains/oc148/httpdocs/catalog/view/theme/default/template/product/category.tpl on line 54
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Hopefully... Qphoria, help please?helenmarie wrote:aah yeh same error here too
I dont know then, maybe Q will be able to help?
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Code: Select all
'description' => preg_replace('/[\r\n\s]+/', ' ', strip_tags(substr(html_entity_decode($result['description']),0,80)))."...",
Code: Select all
'name' => $result['name'],
Code: Select all
/catalog/controller/product/category.php
Code: Select all
<?php echo $products[$j]['description']; ?>
My guess is you've not used the [$j]
Nope, still the same errorJAY6390 wrote:You should have
afterCode: Select all
'description' => preg_replace('/[\r\n\s]+/', ' ', strip_tags(substr(html_entity_decode($result['description']),0,80)))."...",
inCode: Select all
'name' => $result['name'],
Then in your category.tpl you need to useCode: Select all
/catalog/controller/product/category.php
inside the for loop of the productsCode: Select all
<?php echo $products[$j]['description']; ?>
My guess is you've not used the [$j]
Code: Select all
Notice: Undefined index: description in /var/www/vhosts/oc-directory.info/subdomains/oc148/httpdocs/catalog/view/theme/default/template/product/category.tpl on line 54
Code: Select all
<table class="list">
<?php for ($i = 0; $i < sizeof($products); $i = $i + 4) { ?>
<tr>
<?php for ($j = $i; $j < ($i + 4); $j++) { ?>
<td style="width: 25%;"><?php if (isset($products[$j])) { ?>
<a href="<?php echo $products[$j]['href']; ?>"><img src="<?php echo $products[$j]['thumb']; ?>" title="<?php echo $products[$j]['name']; ?>" alt="<?php echo $products[$j]['name']; ?>" /></a><br />
<a href="<?php echo $products[$j]['href']; ?>"><?php echo $products[$j]['name']; ?></a><br />
<span class="smallText"><?php echo $products[$j]['model']; ?></span><br />
<?php echo $products[$j]['description']; ?>
<?php if ($display_price) { ?>
<?php if (!$products[$j]['special']) { ?>
<span class="price"><?php echo $products[$j]['price']; ?></span>
<?php } else { ?>
<div class="price"><span class="ifspecial"><?php echo $products[$j]['price']; ?></span> <span class="special"><?php echo $products[$j]['special']; ?></span></div>
<?php } ?>
<?php } ?>
<a class="button_add_small" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" > </a>
<br />
<?php if ($products[$j]['rating']) { ?>
<img src="catalog/view/theme/default/image/stars_<?php echo $products[$j]['rating'] . '.png'; ?>" alt="<?php echo $products[$j]['stars']; ?>" />
<?php } ?>
<?php } ?></td>
<?php } ?>
</tr>
<?php } ?>
</table>
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Sure!JAY6390 wrote:Can you post your controller code for
/catalog/controller/product/category.php
Code: Select all
$this->data['categories'][] = array(
'name' => $result['name'],
'description' => preg_replace('/[\r\n\s]+/', ' ', strip_tags(substr(html_entity_decode($result['description']),0,80)))."...",
'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url),
'thumb' => $this->model_tool_image->resize($image, $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'))
);
}
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Code: Select all
$this->data['products'][]
Yep, your right. Now it worksJAY6390 wrote:Well theres the problem right there, you're adding it to the categories array, you should be adding it to thearray instead (should be further down the code)Code: Select all
$this->data['products'][]
It will show the ..., can we make the .... click-able?
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
To the product itself.JAY6390 wrote:yeah, to what exactly?
Better would be that the whole Short Description would be click-able.
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Code: Select all
<?php echo $products[$j]['description']; ?>
change it to
Code: Select all
<a href="<?php echo $products[$j]['href']; ?>" alt="<?php echo $products[$j]['name']; ?>"><?php echo $products[$j]['description']; ?></a>
What to do to have the Price always below the text?
Sometimes the currency-sign is next to the text and the price is on the next line/row.
This does not look that good
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Code: Select all
<?php if ($display_price) { ?>
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Yep, thanksfido-x wrote:In your template file (catalog/view/theme/YOUR_TEMPLATE/template/product/category.tpl), find:and insert a <br /> after it.Code: Select all
<?php if ($display_price) { ?>
I tried </br> but that did not do it.
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Users browsing this forum: No registered users and 29 guests