Jump to content

Shopping cart


Recommended Posts

When i add an item to the shopping cart..the item does not show instead these is what i see :


View Store View Cart Clear Cart

Product Id Quantity Amount

$product_id $quantity $ amount

$product_id $quantity $ amount

$product_id $quantity $ amount


require_once '../functions/functions.php';

//call the shopping cart function
$shopping_cart = get_shopping_cart();

echo render_header();

$product_id = $_REQUEST['id'];

<table class ='shoppingCart'>
    <th>Product Id</th>

   //create a local variable called line Item counter
$line_item_counter = 1;

foreach ($shopping_cart->GetItems() as $product_id)
 echo render_shopping_cart_row($shopping_cart, $product_id,$line_item_counter);

function render_shopping_cart_row($shopping_cart, $product_id,$line_item_counter)

    $quantity = $shopping_cart->GetItemQuantity($product_id);
$output = '<tr>
	<td>$ amount</td>
   return $output;


echo render_footer();


Thats my addToCart code. Every other thing worked perfectly well till here..(Lesson7)..Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...