Author |
Message |
dthomas95
Newbie
Joined: 13 Jul 2005
Posts: 7
|
 Link to product from JSP page
I have a site that worked a year ago under 4.0. I've reactivated the site now under 4.0K-4b and the store no longer works.
I have a JSP page that dynamically builds my product page. The list of products are then linked to the selected product page as follows:
<LI><a href="http://www.<my domain name>/agora/agora.cgi?p_id=<%= productId.get(i) %>"><%= size.get(i) %></a></LI>
I see that with the new version, I need something like this:
<LI><a href="http://www.<my domain name>/agora/agora.cgi?cart_id=&xm=on&p_id=<%= productId.get(i) %>"><%= size.get(i) %></a></LI>
After adding the new statement, the link takes me to the agora default home page (html/index.html), instead of the selected product page. From the default home page, the sample links take me on to my store and everything else seems to be working fine. How do I go directly to the product page and circumvent the Agora sample home page? The sample home page runs some agorascript-pre scripts that get the categories from the DB, but this is not what I want to do.
|
Fri Oct 26, 07 12:22 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
What is the actual URL to your store?
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Sat Oct 27, 07 8:12 am |
 |
 |
dthomas95
Newbie
Joined: 13 Jul 2005
Posts: 7
|
|
Sat Oct 27, 07 2:49 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Not the site, the URL to the store..
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Sat Oct 27, 07 5:23 pm |
 |
 |
dthomas95
Newbie
Joined: 13 Jul 2005
Posts: 7
|
|
Mon Oct 29, 07 5:04 am |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
So, do you have a page that has your js so we can see what is happening?
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Mon Oct 29, 07 5:26 am |
 |
 |
dthomas95
Newbie
Joined: 13 Jul 2005
Posts: 7
|
The following is the JSP include file that gets included into the product page. This include page displays all items, two items to a row, within a table. This is the code that attempts to access the shopping cart.
<%@ page import="CategoryBean" %>
<%@ page import="java.util.Vector" %>
<%! String productCategory = "";
Vector size = null;
Vector productId = null; %>
<% productCategory = request.getParameter("product"); %>
<jsp:useBean id="category" class="CategoryBean" scope="session" />
<% category.set(productCategory); %>
<% while(category.hasMore()) {
category.getNext(); // Populates bean attributes with next product in this category %>
<tr>
<td valign="top"><%= category.getImage() %>
<B><%= category.getProductName() %></B><BR><BR>
<UL PLAIN>
<LH>Sizes:</LH>
<% size = category.getSizes(); // Return vector of size descriptions (3 - 7 Husky)
productId = category.getProductIds(); // Return vector of style IDs (E-2317)
for(int i=0; i<size.size(); i++) { %>
<LI><a href="http://www.britchesnbows.us/agora/agora.cgi?cart_id=&xm=on&p_id=<%= productId.get(i) %>"><%= size.get(i) %></a></LI>
<% } %>
</UL><BR><BR>
<%= category.getProductDescription() %>
<BR><BR>
</td>
<% if(category.hasMore()) {
category.getNext(); // Populates bean attributes with next product in this category %>
<td valign="top"><%= category.getImage() %>
<B><%= category.getProductName() %></B><BR><BR>
<UL PLAIN>
<LH>Sizes:</LH>
<% size = category.getSizes(); // Return vector of size descriptions (3 - 7 Husky)
productId = category.getProductIds(); // Return vector of style IDs (E-2317)
for(int i=0; i<size.size(); i++) { %>
<LI><a href="http://www.britchesnbows.us/agora/agora.cgi?cart_id=&xm=on&p_id=<%= productId.get(i) %>"><%= size.get(i) %></a></LI>
<% } %>
</UL><BR><BR>
<%= category.getProductDescription() %><BR><BR>
</td>
</tr>
<% } else { %>
<td> </td>
</tr>
<% break; } %>
<% } // end while %>
Sorry to keep sending only pieces of what you need to help me. Not sure what all you needed beyond the line that accesses the shopping cart. I appreciate your assistance and patience. Since this is a JSP include page, there's a fair amount of code to support the page; so rather than confuse, I'm sending what you request.
Again, thanks!
|
Mon Oct 29, 07 10:51 am |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
I need to see what the script is actually doing...
So if you could give us a link to a page that utilizes this script, we can see what is actually happening.
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Mon Oct 29, 07 11:37 am |
 |
 |
dthomas95
Newbie
Joined: 13 Jul 2005
Posts: 7
|
This link takes you to the page that then links the store when a size is selected:
http://www.britchesnbows.us/productSummary/summaryPage.jsp?product=elderGirlUniforms
To see what is happening, click on any of the 'sizes' links. For one thing, the cart_id parameter is not initialized. I need to know how to do that in my JSP page. Otherwise, I don't know what else may need to be done to make the link to the store work. I'm thinking this may be all that needs to be done, since this page worked with AgoraCart 4.0.
Thanks.
|
Mon Oct 29, 07 11:54 am |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Why are you using the script??? What is the purpose?
You can use the sizes_opt option file for your sizes, couple that with color drop-downs for each size that should take care of things.
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Mon Oct 29, 07 12:10 pm |
 |
 |
dthomas95
Newbie
Joined: 13 Jul 2005
Posts: 7
|
I used JSP because that I understand and the addition of the product link was simple. I don't know how the various html pages inter-relate with the CGI script. The JSP was quicker.
|
Mon Oct 29, 07 1:42 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Well... the database would probably be a lot easier to deal with in the long run.
Let AgoraCart dynamically create the pages... The script is already written to do so...
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Mon Oct 29, 07 1:52 pm |
 |
 |
dthomas95
Newbie
Joined: 13 Jul 2005
Posts: 7
|
Can you point me to a good tutorial showing how to do this? Everything I've found doesn't exactly apply to what I am doing. I'm sure there's one somewhere, just haven't found it.
|
Tue Oct 30, 07 11:51 am |
|
 |
|