Show Product Image Instead Of Product Name On The “Recently Viewed” Block

[color=#000000][font=Arial,]

I'm using CS-Cart 4.1.x[/font][/color][color=#000000][font=Arial,]

I created an override for the block “design\themes\basic\templates\blocks\products\products_text_links.tpl”[/font][/color][color=#000000][font=Arial,]

The code that I see in the default file is:[/font][/color]

{** block-description:text_links **}



<{[color=#00008B]if[/color] $block.properties.item_number == [color=#800000]“Y”[/color]}ol{[color=#00008B]else[/color]}ul{/[color=#00008B]if[/color]} [color=#00008B]class[/color]=[color=#800000]“bullets-list”[/color]>



{[color=#00008B]foreach[/color] [color=#00008B]from[/color]=$items item=[color=#800000]“product”[/color]}

{assign [color=#00008B]var[/color]=[color=#800000]“obj_id”[/color] value=[color=#800000]“$block.block_id000$product.product_id”[/color]}

{[color=#00008B]if[/color] $product}

[color=#800000]

  • [/color]

    $product.product_id"|fn_url}"[/color]>{$product.product nofilter}



  • {/[color=#00008B]if[/color]}

    {/[color=#00008B]foreach[/color]}



    <[color=#800000]/{if $block.properties.item_number == “Y”}ol{else}ul{/[/color][color=#00008B]if[/color]}>[color=#000000][font=Arial,]

    What I need to do is just to replace the following line with the proper code to show the product's default image instead of its name:[/font][/color]

    {$product.product nofilter}[color=#000000][font=Arial,]

    Any ideas?[/font][/color][color=#000000][font=Arial,]

    Thanks[/font][/color]

    Good day,



    At first you should extend the default schema of the block manager. Create the app\addons\my_changes\schemas\block_manager\templates.post.php file with the following content:


    ```php

    $schema['blocks/products/products_text_links.tpl']['bulk_modifier'] = array(
    'fn_gather_additional_products_data' => array (
    'products' => '#this',
    'params' => array (
    'get_icon' => true,
    'get_detailed' => true
    ),
    )
    );
    return $schema;
    ```

    then open your template and replace

    ```php
    {$product.product nofilter}
    ```

    with

    ```php
    {include file="common/image.tpl" image_width="150" image_height="150" images=$product.main_pair obj_id=$obj_id_prefix no_ids=true}
    ```

    Hope this will help.

    Perfect. Thank you so much :)

    [quote name=‘ikramy’ timestamp=‘1419516787’ post=‘200938’]

    Perfect. Thank you so much :)

    [/quote]



    You are welcome!