Close

Change specification filter to load 3 datarows instead of 2

JonJJ
12 years ago
#517 Quote
Avatar
  • 30
Hi Support,


I'm evaluating your products at the moment and so far it is looking good!


I'm creating my own theme in NopCommerce and have changed it to load 3 datarows in the product grid.
So you see 3 products per table row instead of the default 2.



With the Ajax Specification filters where can I tell it to load 3 data rows, instead of the default 2?


Thanks in advance,
Jon
Support
12 years ago
#518 Quote
Avatar
  • Moderator
  • 1044
JonJJ wrote:
Hi Support,


I'm evaluating your products at the moment and so far it is looking good!


I'm creating my own theme in NopCommerce and have changed it to load 3 datarows in the product grid.
So you see 3 products per table row instead of the default 2.



With the Ajax Specification filters where can I tell it to load 3 data rows, instead of the default 2?


Thanks in advance,
Jon


Hi Jon,

Nop Ajax Filters are using the same default Category Template as in the DarkOrange theme in order to show the results with the filtered products.
So if you change the Category Template in the DarkOrange theme then you need to make the same changes in the Category Template of the filters.
You can find it here:
EDIT:SevenSpikes.Nop.AjaxFilters\Views\Catalog7Spikes\CategoryTemplate.ProductsInGridOrLines.cshtml

Regards,
Nop-Templates Support Team

JonJJ
12 years ago
#524 Quote
Avatar
  • 30
Support wrote:

Hi Jon,

Nop Ajax Filters are using the same default Category Template as in the DarkOrange theme in order to show the results with the filtered products.
So if you change the Category Template in the DarkOrange theme then you need to make the same changes in the Category Template of the filters.
You can find it here:
SevenSpikes.Nop.AjaxFilters\Views\Catalog\CategoryTemplate.ProductsInGridOrLines.cshtml

Regards,
Nop-Templates Support Team



Thanks support for the reply.

I got it to work thanks to your support, however it was under "Catalog7Spikes":

SevenSpikes.Nop.AjaxFilters\Views\Catalog7Spikes\CategoryTemplate.ProductsInGridOrLines.cshtml

where I changed the paramter from "2" to "3":

   <div class="@Model.NopAjaxFiltersSettingsModel.ProductsGridPanelSelector.TrimStart(new [] {'.'})">
        @(Html.DataList<ProductModel>(Model.Products, 3,
            @<div class="item-box">
                @Html.Partial("_ProductBox", @item, new ViewDataDictionary())
            </div>
                ))
    </div>




Applying changes only to my theme

After that I wanted to make the changes only in my theme and not the core of the plugin.
I tried copying the view to my theme instead and made the changes there but it did not work.

I tried putting the file from:

SevenSpikes.Nop.AjaxFilters\Views\Catalog7Spikes\CategoryTemplate.ProductsInGridOrLines.cshtml

to my theme at:


SevenSpikes.Nop.AjaxFilters\Themes\HusetVedHavetFilter\Views\Catalog7Spikes\CategoryTemplate.ProductsInGridOrLines.cshtml



Yet still it only shows changes made in the original views.
Any reason why it shouldn't work?

Support
12 years ago
#525 Quote
Avatar
  • Moderator
  • 1044
Hi Jon,

Thank you for the correction it is indeed Catalog7Spikes folder as the Catalog one is used for the Automatic integration of the plugin.

As you probably know all plugin views in nopCommerce are embedded views.
By default nopCommerce doesn't know of any plugin view locations and thus there is no way to have any not embedded views in your plugins.
So in order to have views open to modification we use our own view engine that always searches for views in the actual plugin folder and then it searches in the other view locations i.e Themes. That is why what you are trying is not working as it always finds the view in the plugin folder and never ever gets to the view in your Theme folder.
Last week we made the Filters themeable in terms of the css used in them. So you can have different styling of the Filters and separate them in different themes.
We were thinking of moving also some of the views into the theme but we weren't sure if this would provide any value or would just complicate things more.

If you believe that this is a valuable feature you can add your idea in our UserVoice portal.

Hope this helps!

Best Regards,
Nop-Templates Support Team
JonJJ
12 years ago
#527 Quote
Avatar
  • 30

Thanks for the explanation.

Ok I see, so in other words the views does not work as of yet under your own defined theme for the filter.

It's not a problem, I will just modify the core views ;-)

I do believe that you should try as much as you can to replicate how the engine works in NopCommerce. So if you implement your own view under your theme in the AJAX filters, that should take precedence over the default view - just as in NopCommerce.

Thus if a developer has an understanding of how things work in NopCommerce, he will also immediately know how he should work with things in Nop Ajax Filters.