Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsStoreStoreStore keeps showing Archived Categories and ProductsStore keeps showing Archived Categories and Products
Previous
 
Next
New Post
3/29/2008 6:58 PM
 

Need small help. Currently the store module by default behaves in such a way that if I mark certain category as "archived" then it won't show that category in the catalog, when I mark a product as archived then it won't show the product by default under its category. However if certain search engine or by any other way the user has captured the url for the archived category or product and then pastes the same in a new browser instance, the store will pull up the category/product. The only thing store will not do is when you click "Add to Cart" it will not add to cart.

For my site visitors, I dont think this is a right way to tell them that the category/product is no longer available. You can see the example of what I am trying to explain by visiting following 3 URL's:

http://www.umaisa.com this my main category/product page here you will NOT see any category named "Test"

Now visit http://www.umaisa.com/Home/tabid/36/CategoryID/1/Default.aspx this WILL bring up the archived category named "Test"

Now visit http://www.umaisa.com/Home/tabid/36/ProductID/1/Default.aspx this WILL bring up the archived product named "_Test Product 0".

What I would like to do is somewhat like snowcovered - whenever any visitor visits my site using direct url's for archived categories/products, he should be given a message saying "This Category/Product is no longer avaiable. You will now be redirected to 'Home Page'" and then redirect him to the home page.

To achieve this if in case if I need to modify "Store Core", then that's okay to (as I have already modified enough of store core to fix issues/achieve what we needed).

I thank you much in advance,

Sincerely,


www.dotnetnuke.umaisa.com dnnsupport@dotnetnuke.umaisa.com - free DNN support - www.dotnetnuke.umaisa.com/dnnsupport
 
New Post
3/31/2008 12:54 AM
 

Is this happening only for us or also for others? common guru's something? this is important.

Sincerely,


www.dotnetnuke.umaisa.com dnnsupport@dotnetnuke.umaisa.com - free DNN support - www.dotnetnuke.umaisa.com/dnnsupport
 
New Post
3/31/2008 8:33 PM
Accepted Answer 

Figured out, this can be achived with small tweak in catalog.ascx.cs, and productdetail.ascx.cs.


www.dotnetnuke.umaisa.com dnnsupport@dotnetnuke.umaisa.com - free DNN support - www.dotnetnuke.umaisa.com/dnnsupport
 
New Post
4/1/2008 1:28 AM
 

Hi

Please post the changes you have done to make it work.

It will help others.

Thanks.

 
New Post
4/1/2008 4:15 PM
 

The way we fixed this required core change, compiling and re-creating the dll file named : DotNetNuke.Modules.Store.WebControls.dll; so if you made any other core code changes, please make sure correct versions of the source files are included when you compile this change, else you will loose your original fixes/changes; if you did not change any core code files (.cs) then just compile this change and all is fine.

File Change 1:-
File Folder:  \DesktopModules\Store
File Name: Catalog.ascx.cs
Line: 181
Change Details:

Comment the following 2 lines by prefixing them with "//":
         LiteralControl message = new LiteralControl(Server.HtmlDecode(categoryInfo.Message));
         parent.Controls.Add(message);

Now, insert the following code snippet at line 181 (this will take care of archived category issue):

//Umaisa.us Custom Code - Start
//Original Code:
//LiteralControl message = new LiteralControl(Server.HtmlDecode(categoryInfo.Message));
//parent.Controls.Add(message);
//Original Code had no if, else statements.
//Authorized By: Erwin, Chun
//Dated: 3/31/2008 @4.17pm EST
//UCode: #341-88-9199
//Ref: DotNetNuke Forum (http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/114/threadid/216176/scope/posts/Default.aspx)

if (categoryInfo.Archived)
{
    string _ArchCategoryMsg = Localization.GetString("ArchivedCategoryMsg.Text", this.LocalResourceFile);
    _ArchCategoryMsg = string.Format(_ArchCategoryMsg, ("http://" + PortalAlias.HTTPAlias));
    LiteralControl message = new LiteralControl(Server.HtmlDecode(_ArchCategoryMsg.ToString()));
    parent.Controls.Add(message);
}
else
{
  LiteralControl message = new LiteralControl(Server.HtmlDecode(categoryInfo.Message));
    parent.Controls.Add(message);
}
//Umaisa.us Custom Code - End

File Change 2:-
File Folder:  \DesktopModules\Store
File Name: ProductDetail.ascx.cs
Line: 179
Change Details:

Comment the following line by prefixing them with "//":
                  plhDetails.Controls.Add(TemplateController.ParseTemplate(templatesPath, template, new ProcessTokenDelegate(processToken)));

Now, insert the following code snippet at line 179 (this will take care of archived product issue):

//Umaisa.us Custom Code - Start
//Original Code:
//plhDetails.Controls.Add(TemplateController.ParseTemplate(templatesPath, template, new ProcessTokenDelegate(processToken)));
//Original Code had no if, else statements.
//Authorized By: Erwin, Chun
//Dated: 4/1/2008 @9.20am EST
//UCode: #341-88-9207
//Ref: DotNetNuke Forum (http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/114/threadid/216176/scope/posts/Default.aspx)
if (productInfo.Archived)
{
    string _ArchCategoryMsg = Localization.GetString("ArchivedProductMsg.Text", this.LocalResourceFile);
    _ArchCategoryMsg = string.Format(_ArchCategoryMsg, ("http://" + PortalAlias.HTTPAlias));
    LiteralControl message = new LiteralControl(Server.HtmlDecode(_ArchCategoryMsg.ToString()));
    plhDetails.Controls.Add(message);
}
else
{
    plhDetails.Controls.Add(TemplateController.ParseTemplate(templatesPath, template, new ProcessTokenDelegate(processToken)));
}
//Umaisa.us Custom Code - End

File Change 3:-
File Folder:  \DesktopModules\Store\App_LocalResources
File Name: Catalog.ascx.resx
Change Details:
Add a new string literal as follows:

Name: ArchivedCategoryMsg.Text
Value:
<p align="center"><i>
<b><font face="Tahoma" size="2" color="#FF0000">Sorry this Category is currently
not available.</font><font face="Tahoma" size="2"><br>
You will now be redirected to home page - Thank you.</font></b></i><META HTTP-EQUIV="Refresh" CONTENT="7;URL={0}">
</p>

File Change 4:-
File Folder:  \DesktopModules\Store\App_LocalResources
File Name: ProductDetail.ascx.resx
Change Details:
Add a new string literal as follows:

Name: ArchivedProductMsg.Text
Value:
<p align="center"><i>
<b><font face="Tahoma" size="2" color="#FF0000">Sorry this Product is currently
not available.</font><font face="Tahoma" size="2"><br>
You will now be redirected to home page - Thank you.</font></b></i><META HTTP-EQUIV="Refresh" CONTENT="7;URL={0}">
</p>

We recommend performing all changes using Visual Studio 2005.
Once above changes are made, save all the files, clean the solution and now build the solution. It will create a new file named "DotNetNuke.Modules.Store.WebControls.dll", place this dll, and the .resx (resource files) in your test environment "bin" folder. Delete the site cache, restart the website, restart the application using host-> settings control panel

To test the fix:
1) Login as store admin, pull up any category, copy the url you see in browser, and place it in a notepad,
2) Next pull up any product detail and copy the url you see in browser, and place it in a notepad,
3) Now, go to store admin console, archive the category you pulled up in step 1,
4) Next, archive the product you pulled up in step 2,
5) In the same browser instance now type the category url you made a note of in step 1- you should see the fix kicking in,
6) Finally, in the same browser instace type the product detail url you made a note Step 2 - you should see the fix kicking in.

Online working production fix for above change can be viewed at the following urls: (these urls were included in my original post)
1) Archive Category Fix: http://www.umaisa.com/Home/tabid/36/CategoryID/1/Default.aspx
2) Archive Product Fix: http://www.umaisa.com/Home/tabid/36/ProductID/1/Default.aspx

Hope this helps,

Sincerely,
Support Dept. Umaisa.com


www.dotnetnuke.umaisa.com dnnsupport@dotnetnuke.umaisa.com - free DNN support - www.dotnetnuke.umaisa.com/dnnsupport
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsStoreStoreStore keeps showing Archived Categories and ProductsStore keeps showing Archived Categories and Products


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out