Close

Filter renders _ProductBox from wrong theme

tarweb
10 years ago
#7715 Quote
Avatar
  • 14
Hello,

I am having trouble getting the ajax filter render _ProductBox from the correct theme.

Here is my setup:

Platform is Nopcommerce v3.30.

Purchased and installed the Alfresco theme v3.30 and Ultimate Plugin Collection v3.30.

Multi-site. Let's call them Site A and Site B, with display order 1 and 2 respectively.

Multi-theme. Site A uses DefaultClean, and Site B uses Alfresco.

No customization was done.

The problem is with Site B.

When the category page in Site B first loaded, it looked exactly like how the Alfresco theme should look, which was beautiful. Next, I clicked on a filter (product specification) rendered by AjaxFilters. The category page updated the list of products correctly based on the selected filter. But the _ProductBox was no longer Alfresco. It loaded the DefaultClean version instead.

I stepped through the code to find the source of the bug. What I found was that, in Catalog7Spikes.CatagoryTemplate.ProductsInGridOrLines.cshtml, the WorkingDesktopTheme from the context was returning DefaultClean instead of Alfresco. (Everywhere else was able to identify the theme correctly as Alfresco from context.)

I tested the scenario both in local environment and in hosted environment. Both environments displayed consistent results highlighting the same problem.

This issue is a major show-stopper right now.

Please consider my limitations:
- I can't hardcode theme name or file path in anything
- I can't switch the order of the stores (Site A first, then Site B next)
- I don't want to make any changes to the core
- Deadline is fast approaching to get Site B up and running

What options do I have to correct this behavior?

Some insights on what's happening inside AjaxFilters.dll would be very helpful as well.

Thank you.
Boyko
10 years ago
#7723 Quote
Avatar
  • 1570
tarweb wrote:
Hello,

I am having trouble getting the ajax filter render _ProductBox from the correct theme.


Hi tarweb,

We couldn't reproduce the problem you have described.
The only reason the theme name is DefaultClean instead of Alfresco is that you are missing the Themes\Alfresco folder in the Ajax Filters plugin.
Can you check if this folder is present on your nopCommerce installation:
Plugins\SevenSpikes.Nop.Plugins.AjaxFilters\Themes\Alfresco

Thanks
Regards,
Nop-Templates.com Team
ron.richardson
10 years ago
#8111 Quote
Avatar
  • 6
I'm having a similar issue.  I only have one store, however, but once I apply a filter, it appears to be using a different _ProductBox.  We have ours customized to show "FREE" if a product is $0.00.  Once a filter is applied, it reverts back to showing $0.00.

I have a folder under Themes in the plugin for my theme, and inside that, I have Content and Views.  In the views folder I have the CategoryTemplate.ProductsInGridOrLines.cshtml file in there.

Shouldn't the plugin pick the correct _ProductBox view based on the current theme? Or is there something else needed to make that happen?

I am using version 3.4.
Boyko
10 years ago
#8112 Quote
Avatar
  • 1570
ron.richardson wrote:
I'm having a similar issue ...


Hi ron.richardson,

If you have a theme folder with the name of your theme in the Ajax Filters plugin Themes folder then the plugin will use the current theme when looking for the css of the Ajax Filters.
Finding the correct view i.e _ProductBox.cshtml is handled by the ViewEngine and not the plugin.
As long as you call the _ProductBox like this: @Html.Partial("_ProductBox", product), then it is up to the view engine to find the partial view in the correct theme.
If it doesn't find the correct view then either the view is missing or the ViewEngine doesn't pickup the right theme name.
Regards,
Nop-Templates.com Team