2.0.3 Adding product thumbs in Admin section possible?

this mod work perfectly vor 1.3.x version

[url]http://forum.cs-cart.com/showthread.php?t=7926&highlight=thumbnails[/url]



but anyone have idea in implement this for 2.0.x version?

[quote name=‘mototropic@gmail.com’]this mod work perfectly vor 1.3.x version

[url]http://forum.cs-cart.com/showthread.php?t=7926&highlight=thumbnails[/url]



but anyone have idea in implement this for 2.0.x version?[/QUOTE]





If you havent got is sorted by now the solution is as follows:



It is basically the same as the one in 135, just the names of the database tables were different. No modification has been made to the DB



I used the same code on the orders details page too so that i get a quick look at the products I need rather than reading the description.



I can put that code up too if anyone wants to see where to fit it all in.



Here is the Products Catalog anyway:



skins\basic\admin\views\products\ Manage.tpl



Find the line


```php

```

and below it, insert the line in red as shown

```php


[COLOR="Red"][/COLOR]
```

Then a few more lines down you will find the line that says

```php {foreach from=$products item=product}
```

after this insert the lines of code as shown:

```php

{foreach from=$products item=product}

[COLOR="Red"][/COLOR] ```

screenshot below

screenshot.jpg

Image

{assign var="prod_id" value=$product.product_id}
{php}
$product_id = $this->get_template_vars('prod_id');
$image_id = db_get_row("SELECT image_id FROM cscart_images_links WHERE type='M' AND object_id=$product_id");
$image_id = $image_id['image_id'];
if($image_id == null) {
$image_path = "no_image.gif";
} else {
$image_path = db_get_row("SELECT image_path FROM cscart_images WHERE image_id=$image_id");
$image_path = $image_path['image_path'];
if($image_path == null) {
$image_path = "no_image.gif";
}
}
echo "\"\"";
{/php}

Something is wrong. It pulls out filenames of category images from DB instead.

I found what’s wrong.



Corrected version for Products Catalog:



In the [COLOR=Blue]skins\basic\admin\views\products\manage.tpl[/COLOR] find the line


```php



```and below it, insert the line in red as shown

```php


[COLOR=Red][/COLOR]
```Then a few more lines down you will find the line that says

```php
{foreach from=$products item=product}

```after this insert the lines of code as shown:

```php
{foreach from=$products item=product}

[COLOR=Red][/COLOR]
```
Image

{assign var="prod_id" value=$product.product_id}
{php}
$product_id = $this->get_template_vars('prod_id');
$image_id = db_get_row("SELECT image_id FROM cscart_images_links WHERE [/COLOR][COLOR=Red][COLOR=DarkRed][COLOR=DarkOrchid]object_type='product' AND[/COLOR] [/COLOR][/COLOR][COLOR=Red]type='M' AND object_id=$product_id");
$image_id = $image_id['image_id'];
if($image_id == null) {
$image_path = "no_image.gif";
} else {
$image_path = db_get_row("SELECT image_path FROM cscart_images WHERE image_id=$image_id");
$image_path = $image_path['image_path'];
if($image_path == null) {
$image_path = "no_image.gif";
}
}
echo "\"\"";
{/php}

many thanks for the isue :slight_smile:

Sorry I couldn’t find this thread earlier…:oops: If you want a solution that doesn’t require adding PHP to tpl files, you can check out the alternative solution I posted in the how-to section…



[url]http://forum.cs-cart.com/showthread.php?t=11233[/url]

Hi AXeOMA,



Really Strange, because mine works with your bit added and it works my way too.



But thanks AXeOMA for your help as it will help others too. :wink:

Many thanks for this. Tested on latest version 2.0.4 with no problems so far.

Tested on 2.04 for some reason it does not load all pictures, some are loaded some not.



This mod:

[url]http://forum.cs-cart.com/showthread.php?t=11233[/url]



works like charm!

[quote name=‘Darius’]Tested on 2.04 for some reason it does not load all pictures, some are loaded some not.



This mod:

[url]http://forum.cs-cart.com/showthread.php?t=11233[/url]



works like charm![/QUOTE]



All ok with mine however I did experience one or 2 missing pics so I re-uploaded the pics again and then they appeared. Give it a go… or clear your cache

[quote name=‘Demon Templates’]All ok with mine however I did experience one or 2 missing pics so I re-uploaded the pics again and then they appeared. Give it a go… or clear your cache[/QUOTE]



Thanks for tip, but method in here

[url]http://forum.cs-cart.com/showthread.php?t=11233[/url]



to me appears more professional with no additional php in template files.