473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

agora shopping cart

Hi;

I am no PHP programmer, unfortunately. So your assistance is appreciated.

I am starting to look into using the Agora Shopping cart. There is a page
in there called productPage.inc and I think that this is the page that
formats how products are displayed... currently if there are more than one
product in a category, it uses two columns to display them. How can I
change this to use just one column per product, and the second product to go
in a new row?

Here's the code. Thanks in advance.

<!--agorascript-pre
{ #Start of controller code, probably should leave this alone ;-)
local ($myans)="";
if ($rowCount == (1+$minCount)) { #first one
$ags_row_item=0;
$ags_tot_item=0;
$myans .= '<tr><td colspan=3><table width="100%" border=0>'."\n";
}
$ags_row_item++;
$ags_tot_item++;
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one, need to join these two cells, no border
if ($ags_row_item == 1) { # first and only one
$myans .= '<td width="100%" colspan=2><table width=100% border=0>'."\n";
$myans .= '<tr>'."\n";
}
}
if ($ags_row_item == 2) { # second one
$ags_row_item=0; #reset counter
$myans .= '<td width="50%"><table width=100% border=0>'."\n";
} else { #first one
$myans .= '<tr><td width="50%"><table width=100% border=0>'."\n";
}
return $myans;
} # end of controller code
-->
<TR WIDTH="100%">
<TD ALIGN="CENTER" WIDTH="120" VALIGN="MIDDLE">
<FONT FACE="VERDANA" SIZE="1">

<FORM METHOD = "post" ACTION = "%%scriptURL%%">
%%make_hidden_fields%%
<BR>
%%optionFile%%
<BR>
<P>
<!--BEGIN SELECT QUANTITY BUTTON-->
<TABLE>
<TR ALIGN="CENTER">
<TD VALIGN="MIDDLE">%%QtyBox%%</TD>
<TD VALIGN="MIDDLE">
<INPUT TYPE="IMAGE"
NAME="add_to_cart_button"
VALUE="Add To Cart"
SRC="%%URLofImages%%/add_to_cart.gif" BORDER="0">
</TD>
</TR>
</TABLE>

<!--END SELECT QUANTITY BUTTON-->

</TD>

<TD ALIGN="CENTER" WIDTH="50">%%image%%</TD>

</tr>
<!--agorascript-pre
{ # more controller code
local ($myans)="";
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one
if ($ags_row_item == 1) { # first and only one
$myans .= '</table></td>'."\n";
$myans .= '<td width="50%"><table width=85%>'."\n";
}
}
return $myans;
} # end controller code
-->
<tr>
<TD colspan=2>
<FONT FACE="VERDANA" SIZE="1">
<b>%%name%%</b>
<br>
%%description%%
</FONT>
</TD>
</FORM>
</TR>
<TR>
<td colspan=2><table width='85%' border=0 cellpadding=0 cellspacing=0>
<tr><td width='33%' align=center>
<FONT FACE="VERDANA" SIZE="1" color="#FF0000">%%price%%</font>
</td>
</tr>
</table>
</TD>
</TR>
<!--agorascript-pre
{ # more controller code
local ($myans)="";
if ($ags_row_item == 1) { # first one
$myans .= '</table></td>'."\n";
} else { # second one
$myans .= '</table></td></tr>'."\n";
}
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one, need to join these two cells, no border
if ($ags_row_item == 1) { # first and only one
$myans .= '</tr></table></td>'."\n";
}
}
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one
# if ($ags_row_item == 1) { # finished first one, add a blank dummy
#second
# $myans .= '<td>&nbsp;</td></tr>'."\n";
# }
$myans .= '</table></td></tr>'."\n";
}
return $myans;
} # end controller code
-->
Jul 17 '05 #1
1 1974
Nevermind. The Agora folks, provided a couple to use and choose from!

Thanks anyway!
"Alex Ivascu" <al*********@sbcglobal.net> wrote in message
news:d1*******************@newssvr29.news.prodigy. com...
Hi;

I am no PHP programmer, unfortunately. So your assistance is appreciated.

I am starting to look into using the Agora Shopping cart. There is a page
in there called productPage.inc and I think that this is the page that
formats how products are displayed... currently if there are more than one
product in a category, it uses two columns to display them. How can I
change this to use just one column per product, and the second product to go in a new row?

Here's the code. Thanks in advance.

<!--agorascript-pre
{ #Start of controller code, probably should leave this alone ;-)
local ($myans)="";
if ($rowCount == (1+$minCount)) { #first one
$ags_row_item=0;
$ags_tot_item=0;
$myans .= '<tr><td colspan=3><table width="100%" border=0>'."\n";
}
$ags_row_item++;
$ags_tot_item++;
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one, need to join these two cells, no border
if ($ags_row_item == 1) { # first and only one
$myans .= '<td width="100%" colspan=2><table width=100% border=0>'."\n"; $myans .= '<tr>'."\n";
}
}
if ($ags_row_item == 2) { # second one
$ags_row_item=0; #reset counter
$myans .= '<td width="50%"><table width=100% border=0>'."\n";
} else { #first one
$myans .= '<tr><td width="50%"><table width=100% border=0>'."\n";
}
return $myans;
} # end of controller code
-->
<TR WIDTH="100%">
<TD ALIGN="CENTER" WIDTH="120" VALIGN="MIDDLE">
<FONT FACE="VERDANA" SIZE="1">

<FORM METHOD = "post" ACTION = "%%scriptURL%%">
%%make_hidden_fields%%
<BR>
%%optionFile%%
<BR>
<P>
<!--BEGIN SELECT QUANTITY BUTTON-->
<TABLE>
<TR ALIGN="CENTER">
<TD VALIGN="MIDDLE">%%QtyBox%%</TD>
<TD VALIGN="MIDDLE">
<INPUT TYPE="IMAGE"
NAME="add_to_cart_button"
VALUE="Add To Cart"
SRC="%%URLofImages%%/add_to_cart.gif" BORDER="0">
</TD>
</TR>
</TABLE>

<!--END SELECT QUANTITY BUTTON-->

</TD>

<TD ALIGN="CENTER" WIDTH="50">%%image%%</TD>

</tr>
<!--agorascript-pre
{ # more controller code
local ($myans)="";
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one
if ($ags_row_item == 1) { # first and only one
$myans .= '</table></td>'."\n";
$myans .= '<td width="50%"><table width=85%>'."\n";
}
}
return $myans;
} # end controller code
-->
<tr>
<TD colspan=2>
<FONT FACE="VERDANA" SIZE="1">
<b>%%name%%</b>
<br>
%%description%%
</FONT>
</TD>
</FORM>
</TR>
<TR>
<td colspan=2><table width='85%' border=0 cellpadding=0 cellspacing=0>
<tr><td width='33%' align=center>
<FONT FACE="VERDANA" SIZE="1" color="#FF0000">%%price%%</font>
</td>
</tr>
</table>
</TD>
</TR>
<!--agorascript-pre
{ # more controller code
local ($myans)="";
if ($ags_row_item == 1) { # first one
$myans .= '</table></td>'."\n";
} else { # second one
$myans .= '</table></td></tr>'."\n";
}
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one, need to join these two cells, no border
if ($ags_row_item == 1) { # first and only one
$myans .= '</tr></table></td>'."\n";
}
}
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one
# if ($ags_row_item == 1) { # finished first one, add a blank dummy
#second
# $myans .= '<td>&nbsp;</td></tr>'."\n";
# }
$myans .= '</table></td></tr>'."\n";
}
return $myans;
} # end controller code
-->

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Don Grover | last post by:
I am retrieving costs and product id's from a sql db. and need to build a shopping cart around it. How do I store the selected items and qty req so I can move into another catalog and total up as...
2
by: Paul Bruneau | last post by:
Hi, I hope someone can help me make a working shopping cart, as a learning tool. If I have a "Product Demo" html page with a "Buy Me" button, there must be a simple javascript method of...
1
by: madison | last post by:
Hi, I am trying to start a website using paypals shopping cart function. If i have 10 items and they sell out, how do I make it so the item is then listed as sold out. The next person would not...
1
by: Jia Sun | last post by:
hello , everybody , i need a similar program , just like fancyimport.com if possible, pls contact me ,thank you very much . inchina@gmail.com
1
by: Adil Akram | last post by:
I have created a site shopping cart in ASP.net. I am using ASP session object's SessionID on non SSL connection to track session. While adding products to cart DB I insert product and SessionID...
2
by: G.E.M.P | last post by:
High Level Session Handling Design for a Shopping cart 0) What am I missing? 1) How does OSCommerce do it? I'm thinking about building a shopping cart from scratch, using a library of dynamic...
7
by: isaac2004 | last post by:
hi i have a basic asp page that acts as an online bookstore. on my cart page i am having trouble generating 3 numbers; a subtotal, a shipping total, and a final price. here is my code i would...
1
by: jecha | last post by:
I'm implementing a shopping cart but am having a problem in checking out a person who has added item in his/her shopping busket.The code for the checkout.php script is given below <?...
3
by: Paulo | last post by:
Hi, beginner on asp.net 2.0 C# VS 2005, how can I use the shopping cart concept on my application? When the user clicks add item, it will be stored on some storage format, I dont know what is the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.