Add apperance type to Product Filter

Does anyone know how I can add a new appearance type to Product Filters using an add_on. I thought

doing this in my structure.post.php would work but alas it did.



$schema['product_filters']['appearances']['blocks/pfilt.tpl'] = array (
'conditions' => array (
'fillings' => array('filters')
),
);

I finally figured it out and thought it would be a great idea to note it for other users

since I have seen others ask and never get an answer. For some reason it took me forever

to figure this out. In the end the solution was simpler than I expected.

You can use the existing my_changes add_on or your own add-on. First you need to add the

correct folders to the add-on.


  1. Create a “schema” folder under (not the skins folder but the root of CS-Cart) /addons/my_changes/.
  2. Create a “block_manager” folder under the “schema” folder you just created.
  3. Create a structure.post.php file under “block_manager”.
  4. Add the appropriate code to the structure.post.php file.



    For example: I wanted to create a new appearance type for Product Filters

    using the “filters” filling. I created my new template under my

    “customer/addons/my_changes” folder and called it filter_menu.tpl. Then to have

    it appear when editing the blocks in the admin I added the following

    code to the structure.post.php file. You can learn a lot by viewing the

    /schemas/structure.php file to learn more about adding appearance types

    and fillings to categories,products, etc…


```php


if ( !defined('AREA') ) { die('Access denied'); }

$schema['product_filters']['appearances']['my_changes/filter_menu.tpl'] = array (
'conditions' => array (
'fillings' => array('filters')
),

);

?> ```

Note: if anyone has a better way of doing this please chime in.

Thanks for the info…how does it look now do you have any shots.



thanks

john

[quote name='johnbol1' timestamp='1320076331' post='124993']

Thanks for the info…how does it look now do you have any shots.



thanks

john

[/quote]









[attachment=4673:screen.gif]

screen.gif

Where is the relevancy in your screenshot? The filters appear like that in my cart without any of your code integrated…?

I think he's talking about the brands showing up?

[quote name=‘Flow’ timestamp=‘1320086823’ post=‘125008’]

I think he’s talking about the brands showing up?

[/quote]

correct flow :)

Thanks for this !

[quote name='m-space' timestamp='1323264696' post='127438']

Thanks for this !

[/quote]



Although in trying to extend the Category listings it goes a bit wrong…



I have


$schema['categories']['appearances']['my_changes/categories_new_multicolumns.tpl'] = array (
'params' => array (
'get_images' => true
)
);




In my code which is the same as the code from structure.php but reformatted. The problem that occurs is that it doesn't show the specific settings for the new multicolumn option so I am unable to set the required quantity and then there is no output !



Any advice is greatlt appreciated.

Okay well I created a specific_settings.post.php with the following


```php


if ( !defined('AREA') ) { die('Access denied'); }

$schema = array (
'appearances' => array (
'my_changes/categories_new_multicolumns.tpl' => array (
'number_of_columns' => array (
'type' => 'input',
'default_value' => 2
)
)
)
)
?> ```

Which now shows the options in the 'specific settings' menu for the new option

But for some reason the new template is not being called in the page block in the frontend.

Any ideas?

Your path to your tpl is incorrect it should be addons/my_changes/categories_new_multicolumns.tpl.

[quote name='solesurvivor' timestamp='1341928408' post='140322']

Your path to your tpl is incorrect it should be addons/my_changes/categories_new_multicolumns.tpl.

[/quote]



Solesurvivor,



Thanks for the reply, I had fixed it shortly after posting but forgotten all about this post in the meantime!



Regards