I want to get product code (module) into featured products module opencart
see this example of what I want http://demo.pure-sol.com/fahmy/test.jpg
I did some code but there something wrong with the result
\\catalog\\controller\\module\\featured.php
$this->data['text_model'] = $this->language->get('text_model'); // line 10
$this->data['model'] = $product_info['model']; // line 54
catalog\\language\\english\\module\\featured.php
$_['text_model'] = 'Model';
catalog\\view\\theme\\fashionfever\\template\\module\\featured.tpl
<div class="feature">
<h2> <?php echo $heading_title; ?></h2>
<div class="box-content">
<div class="box-product">
<?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>
<!-- additional code --> <p><?php echo $text_model; ?>: <a href="<?php echo $product['href']; ?>"><?php echo $model; ?></a></p>
<?php } ?>
</div>
</div>
</div>
remove the line
$this->data['model'] = $product_info['model']; // line 54
and in $this->data['products'][] = array(
add this line
'model' => $product_info['model'],
add this
<p><?php echo $text_model; ?>: <a href="<?php echo $product['href']; ?>"><?php echo $product['model']; ?></a></p>
just after
<div class="cart"><input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" /></div>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.