OK, thank you for finding that problem!
We want to try it because in our business we already use endicia to print our shipping labels, but we must copy/paste the shipment info from nopcommerce order screen into endicia screen for each shipment in order to generate the labels. This plugin has the label generator within nopcommerce so you can print labels without leaving the nopcommerce admin screen...
Hello-
Yesterday, I installed a plugin from another developer ( http://www.nopcommerce.com/p/1106/calculate-print-usps-labels.aspx ).
Now, I cannot access the articles list or articles group list in the administration area. Page not found...404.
I can access the configure screen OK, and the public pages work OK, too.
I tried un-installing the other plugin, but the problem remains.
Do you have a suggestion for me?
Thanks,
Steve
I think this is the right solution, but for people with more than 2 stores, you would need to use if/elseif logic, or in the case of more than 5, maybe a case/switch for better readability.
Maybe at some point, the option for having a separate stylesheet could be added into the plugin configuration as a feature?
..this would at least allow for simple design differences to the List.cshtml, Search.cshtml, and ArticlePost.cshtml views for each store. For most users of the plugin, this would be sufficient.
The "Printer-friendly" version (ArticlePostPrint.cshtml) is different, and already requires manual customization for most people anyway to make it more or less "friendly". (e.g: removing related product-box's and adding their company logo)
Anyway...we love the plugin and appreciate your continued efforts to provide needed functionality!
Steve
Problem solved. This is the code I used on ArticlePostPrint.cshtml:
I changed this:
<link href="/Plugins/FoxNetSoft.Articles/Styles/styles-print.css" rel="stylesheet" type="text/css" />
@{
string currentstore=HttpContext.Current.Request.ServerVariables["HTTP_HOST"];
string imgsrc="";
string alttag="";
if (currentstore == "www.mydomain.com")
{
<link href="/Plugins/FoxNetSoft.Articles/Styles/styles-store1-print.css" rel="stylesheet" type="text/css" />
imgsrc="/content/images/uploaded/store1_logo.jpg";
alttag="Store 1 Name";
}
else
{
<link href="/Plugins/FoxNetSoft.Articles/Styles/styles-store2-print.css" rel="stylesheet" type="text/css" />
imgsrc="/content/images/uploaded/store2_logo.jpg";
alttag="Store 2 Name";
}
}
<a href="@Url.RouteUrl("HomePage")" class="logo"><img alt="Store 1 Name" src="/path/to/my/images/store1_logo.jpg"></a>
Actually, only the imgsrc variable I create is the problem, because the error is further down the page, where I call it:
<a href="@Url.RouteUrl("HomePage")" class="logo"><img alt="" src="@imgsrc"></a>
I forgot about the ArticlePostPrint.cshtml
I also need for it to have it's own styling, and the second store's logo to appear on it.
I have written this code for that view, but it is not working:
@{
string currentstore=HttpContext.Current.Request.ServerVariables["HTTP_HOST"];
if (currentstore == "www.mydomain.com")
{
<link href="/Plugins/FoxNetSoft.Articles/Styles/styles-print.css" rel="stylesheet" type="text/css" />
string imgsrc="/content/images/uploaded/store1_Logo_Print_Friendly.jpg";
}
else
{
<link href="/Plugins/FoxNetSoft.Articles/Styles/styles-NATURALS-print.css" rel="stylesheet" type="text/css" />
string imgsrc="/content/images/uploaded/store2_Logo_print_friendly.gif";
}
}
OK...nevermind....I finally figured out a solution:
I replaced this line on those two views:
Html.AddCssFileParts("~/Plugins/FoxNetSoft.Articles/Styles/styles.css");
string currentstore=HttpContext.Current.Request.ServerVariables["HTTP_HOST"];
if (currentstore == "www.mydomain.com")
{
Html.AddCssFileParts("~/Plugins/FoxNetSoft.Articles/Styles/styles1.css");
}
else
{
Html.AddCssFileParts("~/Plugins/FoxNetSoft.Articles/Styles/styles2.css");
}
steveembry66@gmail.com wrote:
Or maybe it is best to just use host headers to determine which stylesheet to use?
Something like this?
currentstore = Page.Context.Request.Headers.GetValues("Host");
if (currentstore == 'OriginalStoreDomainName.com')
{
Html.AddCssFileParts("~/Plugins/FoxNetSoft.Articles/Styles/store1-styles.css");
}
else
{
Html.AddCssFileParts("~/Plugins/FoxNetSoft.Articles/Styles/store2-styles.css");
}
Thanks for your help!
Steve