Display Short Description In Block "most Popular"

Hello,

I have a block in Home Page with the "most popular" products in it. I have selected the Grid View for this block..

Now, I would like to display the short Description under the Title of the product!

So, inside file: templates/blocks/list_templates/grid_list.tpl

I am trying to grab this product description value, but nothing seems to displayed.. I saw the debugger too and still did not find this value..

I am trying something like:

{assign var="index_short_desc" value=$product.short_description}

{$index_short_desc}

Any suggestions, help? thanks!

*cs-cart version is 4.3.9

Hello,

I have a block in Home Page with the "most popular" products in it. I have selected the Grid View for this block..

Now, I would like to display the short Description under the Title of the product!

So, inside file: templates/blocks/list_templates/grid_list.tpl

I am trying to grab this product description value, but nothing seems to displayed.. I saw the debugger too and still did not find this value..

I am trying something like:

{assign var="index_short_desc" value=$product.short_description}

{$index_short_desc}

Any suggestions, help? thanks!

*cs-cart version is 4.3.9

try: {$product.short_description nofilter}

Unfortunatelly, I tried this but no luck... Exactly under this code for title:


{if $item_number == "Y"}
{$cur_number}. 
{math equation="num + 1" num=$cur_number assign="cur_number"}
{/if}

{assign var="name" value="name_$obj_id"}
{$smarty.capture.$name nofilter}

I did not give any prefix wrapper style to this block.. if that helps.. that's why I am using this tpl file (../grid_list.tpl)

Any other suggestion? thanks for reply anyway!

app/schemas/block_manager/blocks.php

replace:

                    'most_popular' => array(
                        'params' => array(
                            'popularity_from' => 1,
                            'sort_by' => 'popularity',
                            'sort_order' => 'desc',
                            'request' => array(
                                'cid' => '%CATEGORY_ID'
                            )
                        ),
                    ),

with

                    'most_popular' => array(
                        'params' => array(
                            'popularity_from' => 1,
                            'sort_by' => 'popularity',
                            'sort_order' => 'desc',
                            'request' => array(
                                'cid' => '%CATEGORY_ID'
                            ),
                            'extend' => array('description')
                        ),
                    ),

Then clear cache and use code from post #2

short description is displayed correctly now! this is what I was looking for!! thank you all, for the help!

+ post up

Hello there,

I would like something more about this one..sorry! I changed the block from most popular to 'manually' add products... And now the short description does not appar!

I insert the above code to manually block too, but it does not appear...

'fillings' => array(
'manually' => array(
'picker' => 'pickers/products/picker.tpl',
'picker_params' => array(
'type' => 'links',
'positions' => true,
),
'extend' => array('description')
),

'newest' => array(
'params' => array(
'sort_by' => 'timestamp',
'sort_order' => 'desc',
'request' => array(
'cid' => '%CATEGORY_ID%'
),
'extend' => array('description')
)
),

How could I do this to work?

thanks in advance!

Please try.

                    'manually' => array(
                        'picker' => 'pickers/products/picker.tpl',
                        'picker_params' => array(
                            'type' => 'links',
                            'positions' => true,
                        ),
                        'params' => array(
                            'extend' => array('description')
                        )
                    ),

(!) Not tested

I wouldnt change core files !

you can extend the scheme block_manager/blocks by creating the schemas/block_manager directory in your my_changes add-on directory and putting the extension data in the file blocks.pre.php or blocks.post.php .

A nice example is here https://github.com/cscart/affiliate/blob/master/app/addons/affiliate/schemas/block_manager/blocks.post.php

Please try.

                    'manually' => array(
                        'picker' => 'pickers/products/picker.tpl',
                        'picker_params' => array(
                            'type' => 'links',
                            'positions' => true,
                        ),
                        'params' => array(
                            'extend' => array('description')
                        )
                    ),

(!) Not tested

I did try that. Unfortunatelly this not working! thanks anyway!!!


I would try this one #8 and tell you how this goes! thanks

I wouldnt change core files !

you can extend the scheme block_manager/blocks by creating the schemas/block_manager directory in your my_changes add-on directory and putting the extension data in the file blocks.pre.php or blocks.post.php .

A nice example is here https://github.com/cscart/affiliate/blob/master/app/addons/affiliate/schemas/block_manager/blocks.post.php

Totally agree with Foits. If you are familiar with schema extension, it is better to use this feature. In other case changes can be lost after upgrade

I did try that. Unfortunatelly this not working! thanks anyway!!!


I would try this one #8 and tell you how this goes! thanks

Note that in your example you use:

                        'extend' => array('description')

but we suggest to use:

                        'params' => array(
                            'extend' => array('description')
                        )

Did you try that?

Note that in your example you use:

                        'extend' => array('description')

but we suggest to use:

                        'params' => array(
                            'extend' => array('description')
                        )

Did you try that?

I tried that, but I guess I had syntax errors! You are right, it is working correctly! Although, I would like to know more about not changing the core files, for obvious reasons! Thank you both for your help! I could not understand perfectly the link of #8 you gave me..and how to extend the scheme

I tried that, but I guess I had syntax errors! You are right, it is working correctly! Although, I would like to know more about not changing the core files, for obvious reasons! Thank you both for your help! I could not understand perfectly the link of #8 you gave me..and how to extend the scheme

For example, you can use My changes module and create the following file:

app/addons/my_changes/schemas/block_manager/blocks.post.php

content:

$schema[‘products’][‘content’][‘items’][‘fillings’][‘manually’][‘params’] = array (
‘extend’ => array(‘description’)
);

return $schema;

For example, you can use My changes module and create the following file:

app/addons/my_changes/schemas/block_manager/blocks.post.php

content:

$schema[‘products’][‘content’][‘items’][‘fillings’][‘manually’][‘params’] = array (
‘extend’ => array(‘description’)
);

return $schema;

Yes this is the way to do it. Don't forget in the process to activate the My Changes Addon, cause you wont get any results if you don't.

Fotis

Yes this is the way to do it. Don't forget in the process to activate the My Changes Addon, cause you wont get any results if you don't.

.. and clear cache also as schemas are cached in CS-Cart

.. and clear cache also as schemas are cached in CS-Cart

Exactly

Clear Cache is my second name.....

Excellent! Thank you both for these information about schema and the procedure of doing that!

Excellent! Thank you both for these information about schema and the procedure of doing that!

We are glad to help you

Hi guys,

Thanks for this topic. Works like a charm.

I've used it in ULT v4.13.1.SP2 to organize products in categories.

You are welcome! :)