I have 3 themes set up in my store. First theme is the default for the entire store, and set in the Admin section. The other 2 themes are used to show differences between product in two different categories.
In the Admin section for the two categories, I have their themes configured for their respective look and feel. The themes are working perfectly for the categories and products, however, when I add a product to the cart, and the product accessories page opens, it is taking the default theme. Is there any way to set the product accessories theme to the same theme that the product bought has?
Thanks
Inherit Theme - Product Accessories Page
Re: Inherit Theme - Product Accessories Page
Well ASP.NET provides ways to change the theme through code. For this you have to set the Page.Theme property in the Page_PreInIt event handler like below
So for those pages where you want to have different themes when having products from different categories, First put above function in those pages and then update function to decide theme depedning upon your criteria. For example if it depends upon category then it could be something like
Code: Select all
protected void Page_PreInit(object sender, EventArgs e)
{
Page.Theme = "theme name";
}
Code: Select all
protected void Page_PreInit(object sender, EventArgs e)
{
Product product = ProductDataSource.Load(PageHelper.GetProductId());
if(product.Categories[0] == 25)
Page.Theme = "theme1";
else
if(product.Categories[0] == 35)
Page.Theme = "theme2";
}