Moving logic from Show Product 1.htm to conlib file

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Moving logic from Show Product 1.htm to conlib file

Post by jmestep » Wed Apr 02, 2008 5:45 pm

I'm using the tabbed description control that Joe invented to display Reviews, Extended Descriptions, and Customers also bought.
I've got the review panel in there OK by

<%@ Register Src="ProductReviewsPanel.ascx" TagName="ProductReviews" TagPrefix="uc" %>

and
<uc:ProductReviews ID="ProductReviews" runat="server" />

I'm just not sure how to take the logic of whether to display the reviews or not from the Show Product 1.htm and use it to display the reviews. That logic is:
#if($store.Settings.ProductReviewEnabled != "None")
#if($store.Settings.ProductReviewEnabled == "Registered")
#if($customer.IsAnonymous == false)

I've got Joe's control in the Show Product 1.htm, as below, but I can't put the review logic around it because it displays other things in the other two tabs.
<tr><td colspan="2">[[Conlib:Custom/ProductDescriptionTabbed]]</td></tr>

thanks
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Moving logic from Show Product 1.htm to conlib file

Post by AbleMods » Wed Apr 02, 2008 9:31 pm

I would take it out of the .htm file altogether and include it in the buyproductdialog user control instead.

Then you can just set the .visible property on the product rating control depending on your need.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Moving logic from Show Product 1.htm to conlib file

Post by jmestep » Thu Apr 03, 2008 7:58 am

I was thinking about that, but I hadn't figured out how to write the wording for the logic. In the .cs file?
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Moving logic from Show Product 1.htm to conlib file

Post by AbleMods » Thu Apr 03, 2008 9:36 am

Yeah but you'll have to make changes to both the HTML side and the .cs side of the page.

On the HTML side, I think there's already a reference to a different user control included in BuyProductDialog. Just look at how they're adding it at the top and then referencing it down in the HTML.

Then on the .cs side, you could just set that user controls (id).Visible = False in Page_PreRender if you don't want it displayed on the BuyProductDialog. Obviously based on whatever criteria you want to test for in the code.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Post Reply