By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,968 Members | 1,684 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,968 IT Pros & Developers. It's quick & easy.

agora shopping cart

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.