Print Page | Close Window

Page Navigation - Brand

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=1391
Printed Date: 22-April-2025 at 9:38am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Page Navigation - Brand
Posted By: knifepro
Subject: Page Navigation - Brand
Date Posted: 20-February-2008 at 11:02am

I would like to include to a Shop By Brand list on all my pages like the Browse by Category list? The Shop by Brand could be a drop-down menu or a full list. Has anyone else added a menu like this. If so I would appreciate the code help. I am new to ProductCart.



-------------
Brian

brian@theknifeprofessional.com
brian@heartlandbraidedrugs.com
www.theknifeprofessional.com
www.heartlandbraidedrugs.com
ProductCart v4.7
QuickBooks Sync
Mobile



Replies:
Posted By: Greg Dinger
Date Posted: 20-February-2008 at 11:19am

Preparing such a list is as simple as opening a recordset, looping through the records and writing the code in the form you desire (Assuming you want it dynamic.)  If you are comfortable with ASP scripting, viewbrands.asp would be a good page to reference for constructing such a module.  Or a developer could build that for you.

Alternatively, a hard-coded dropdown would also be easy to code. You would have to maintain it when the available brands change, but the code would be fairly simple.

 



-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: knifepro
Date Posted: 21-February-2008 at 3:27pm

I got the brand list to appear and link to the correct brand but if you click on a Brand that does not have any products then I get an error message in the brand list.

Here is the code I am using. Any suggestions:

<table>
                              <%
       'Show brands, if any
       query="Select * from Brands order by BrandName asc"
       set rstemp4=Server.CreateObject("ADODB.Recordset")
       set rstemp4=connTemp.execute(query)
       if not rstemp4.eof then%>
         <tr>
        <td>
                                     <%do while not rstemp4.eof%>
                                     <tr>
                                     <td>
                                     <a href="showsearchresults.asp?IDBrand=<%=rstemp4("IDBrand") %>&iPageSize=9"><%=rstemp4("BrandName")%>< ;/a>
                                     </td>
                                     </tr>
                                     <%rstemp4.MoveNext
             loop%>
                                   </td>
  </tr>
        <%end if%>
                                </table>

My development site is located at: http://208.75.248.150/store/pc/home.asp - http://208.75.248.150/store/pc/home.asp . I am new to ASP. I am using MS SQL database. Do anyone see a problem with over taxing the database?  I will have about 80 brands.



-------------
Brian

brian@theknifeprofessional.com
brian@heartlandbraidedrugs.com
www.theknifeprofessional.com
www.heartlandbraidedrugs.com
ProductCart v4.7
QuickBooks Sync
Mobile


Posted By: netprofits
Date Posted: 21-February-2008 at 3:35pm

Whenever you're doing something like this where the ASP code needs to run on every page of the site to load information from the database (i.e. its in the header file), we recommend moving that code into the control panel and only running the routine when you modify your brands. You would create a new ASP page in the control panel that  creates your HTML list and writes it out to an HTML include file. Then your header.asp file would just include the brands list include file.

This is the same concept behind the Product Cart "Generate Navigation" function. It increases performance of each page and decreases load on your database.

You could review the pcadmin/gencatnavigation.asp to see how it does this.



-------------
NetProfits Internet Consulting

Certified ProductCart Developer

http://www.nicwebdesign.com" rel="nofollow - Our Site


Posted By: Greg Dinger
Date Posted: 21-February-2008 at 3:44pm

Dan - I explained the alternatives (the approach he has implemented versus generating an include file) to him yesterday when he asked me to bid the project.

The one thing he missed was to close and destroy the recordset and db connection. 



-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net