|
General Details
|
|
PHP (Hypertext Preprocess...
|
|
Posted 1.2 Year Ago
|
|
943 Views
|
|
Received 0 Ratings
|
|
[PHP] Shopping Cart Class (SESSION-based)
Description
This is a very easy to use PHP class that is also very portable. Everything is explained in the class on what it is and how to use it.
Technical
Required PHP 5.x and use of SESSION's
Source Code
Comments
| Please login to post comments. |
|
|
Izzmo,
This is a gods send if I can get it to work.
The main question is how to put it together with what is in place, or does it replace ?? , and how ?? new at php.
On the product pages I have;
<form id="form1" name="form1" method="post" action="">
<input type="hidden" name="product" value="<tr>
<td><? print_r($product[1][0]) ; ?></td>
<td><? print_r($style[1][1]) ; ?></td>
<td><? print_r($weight[1][2]) ; ?></td>
<td><? print_r($sprice[1][3]) ; ?></td></tr>">
<input type="submit" name="Submit1" value="Ad To Cart">
</form>
To place the info on the checkout page is;
<table align="center" borber="0" Width="700">
<tr>
<td width="200">Product</td>
<td width="200">Style</td>
<td width="100">Weight</td>
<td width="100">Price</td>
</tr>
<tr>
<td> <td>
<td> </td>
<td> </td>
<?php
foreach ($_SESSION as $key => $value) {
if (strpos($key, 'Submit') === 0) {
continue;
}
echo "$value", "<br>" ;
}
?>
</table>
The information is held is session with id's as;
$_session['product'] = "product[1][0]" ;
$_session['style'] = "style[1][1]" ;
$_session['weight'] = "weight[1][2]" ;
$_session['sprice'] = "sprice[1][3]" ;
$product[1][0] = "Alfalfa" ;
$style[1][1] = "Cut And Sifted" ;
$weight[1][2] = "1 lbs." ;
$sprice[1][3] = "17.78" ;
$shipping[1][5] = "5.00" ;
So, the question is, how does this get intagrated with.
The web page is; http://www.pro-health-herbal-supplements.com
The php is being worked live on the server, page was posted 2 weeks ago.
You can understand my eurgency about getting the session cart compleated.
Thank You Gary
|
More "PHP (Hypertext Preprocessor)" Source Codes By This Author
Recently Posted "PHP (Hypertext Preprocessor)" Source Codes
Recently Rated "PHP (Hypertext Preprocessor)" Source Codes
|