Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Display Short Description In Block "most Popular" Rate Topic   - - - - -

 
  • dataspotgr
  • Member
  • Authorized Reseller
  • Join Date: 04-Sep 13
  • 42 posts

Posted 09 August 2016 - 11:08 AM #1

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



 

Posted 09 August 2016 - 12:20 PM #2

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}


John Carroll
My Webshop: Alpha Spas

 
  • dataspotgr
  • Member
  • Authorized Reseller
  • Join Date: 04-Sep 13
  • 42 posts

Posted 09 August 2016 - 12:30 PM #3

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

 

<div class="ty-grid-list__item-name">
{if $item_number == "Y"}
     <span class="item-number">{$cur_number}.&nbsp;</span>
     {math equation="num + 1" num=$cur_number assign="cur_number"}
{/if}

{assign var="name" value="name_$obj_id"}
{$smarty.capture.$name nofilter}
                                                                                        
</div>

 

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!



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19851 posts

Posted 09 August 2016 - 02:09 PM #4

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • dataspotgr
  • Member
  • Authorized Reseller
  • Join Date: 04-Sep 13
  • 42 posts

Posted 10 August 2016 - 06:48 AM #5

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

 

+ post up



 
  • dataspotgr
  • Member
  • Authorized Reseller
  • Join Date: 04-Sep 13
  • 42 posts

Posted 29 August 2016 - 09:09 AM #6

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!



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19851 posts

Posted 29 August 2016 - 02:14 PM #7

Please try. 

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

(!) Not tested


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • dvsgr
  • Senior Member
  • Authorized Reseller
  • Join Date: 14-Apr 09
  • 1449 posts

Posted 29 August 2016 - 09:20 PM #8

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/c...blocks.post.php


Fotis Kourmadas
Cs-Cart Development - Cs-Cart Authorized Reseller 

 
  • dataspotgr
  • Member
  • Authorized Reseller
  • Join Date: 04-Sep 13
  • 42 posts

Posted 30 August 2016 - 06:33 AM #9

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



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19851 posts

Posted 30 August 2016 - 06:54 AM #10

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/c...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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19851 posts

Posted 30 August 2016 - 07:00 AM #11

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?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • dataspotgr
  • Member
  • Authorized Reseller
  • Join Date: 04-Sep 13
  • 42 posts

Posted 30 August 2016 - 09:34 AM #12

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



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19851 posts

Posted 30 August 2016 - 02:16 PM #13

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:

<?php

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

return $schema;

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • dvsgr
  • Senior Member
  • Authorized Reseller
  • Join Date: 14-Apr 09
  • 1449 posts

Posted 30 August 2016 - 04:11 PM #14

 

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

 

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

 

content:

<?php

$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


Fotis Kourmadas
Cs-Cart Development - Cs-Cart Authorized Reseller 

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19851 posts

Posted 31 August 2016 - 07:23 AM #15

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • dvsgr
  • Senior Member
  • Authorized Reseller
  • Join Date: 14-Apr 09
  • 1449 posts

Posted 31 August 2016 - 07:37 AM #16

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

 

Exactly

 

Clear Cache is my second name.....


Fotis Kourmadas
Cs-Cart Development - Cs-Cart Authorized Reseller 

 
  • dataspotgr
  • Member
  • Authorized Reseller
  • Join Date: 04-Sep 13
  • 42 posts

Posted 31 August 2016 - 10:38 AM #17

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



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19851 posts

Posted 31 August 2016 - 02:21 PM #18

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

 

We are glad to help you


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.