Post by gokaydemir86 » Sun Sep 10, 2017 8:39 am

Hi, I made some changes in

Code: Select all

 Model File :   \catalog\model\checkout\order.php
and

Code: Select all

 TPL File   :   \catalog\view\theme\journal2\template\mail\order.tpl
Here is my edits:
First, on order.php, around 548. line, under the code

Code: Select all

 foreach ($order_product_query->rows as $product) {
					$option_data = array();


I added:

Code: Select all

 foreach ($order_product_query->rows as $order_product) {
					$product_info = $this->model_catalog_product->getProduct($order_product['product_id']);
					if ($product_info['image']) {
						$thumbbuyuk = $this->model_tool_image->resize($product_info['image'], 130, 130);
					} else {
					$thumbbuyuk = '';
					}
					}
After that, around 581, under the code

Code: Select all

 $data['products'][] = array(
I added:

Code: Select all

'thumbbuyuk' => $thumbbuyuk,
'href' 	 => $this->url->link('product/product', 'product_id=' .$product_info['product_id']),
Finally, on order.tpl file, under the code

Code: Select all

<p style="margin-top: 0px; margin-bottom: 20px;"><?php echo $text_greeting; ?></p>
I added:

Code: Select all

<div style="text-align:center;">
		<?php foreach ($products as $product) { ?>
			<?php if ($product['thumbbuyuk']) { ?>
				<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumbbuyuk']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a>
               <?php } ?>
		<?php } ?>
     </div>
Everything is looking good. And also images are shown exactly how I wanted. However, if there are more than one order,then there is a problem: When I click the images, links are always the same as the first image. That's, my edits fetch the images but links.. What is wrong in my edits? Any answer would be appreciated.

Newbie

Posts

Joined
Tue Jul 18, 2017 8:08 am
Who is online

Users browsing this forum: No registered users and 7 guests