Jump to content

Jon Lebensold shopping cart


shaman

Recommended Posts

Hi

first i would like to say the videos are great, i have downloaded the php shopping cart and it works great,but i want to add more items to the site page, i added more items to the store.xml file but when i open the site up on my localhost the items just keep going in the same row has the first one's, what i am tring to do is have 3 items on the top row,which is how is,and when i add more items i would like it to start a new row. If anybody can help me i would be very greatfull.:D

Link to comment
Share on other sites

Add a counter, and when you reach 3 print "

Hope it helps!

 

//Emil

 

Edit: Example, somthing like this:

$i = 0;
echo "";
foreach (get_shopping_cart() as $prod)
{
   echo "$prod";

   if ($i >= 2)
   {
       echo "";
       $i = 0;
   }
   else
       i++;
}
echo "";

Edited by Korken
Link to comment
Share on other sites

Hi Korken

thanks for your help but still did not work i hope this code will help you help me,thanks

function render_products_from_xml()

{

$output = "

 

foreach (get_xml_catalog() as $product)

{

$output .= "

$product->title

$product->img

$product->description

?$product->price

";

}

 

 

$output .= "

";

 

return $output;

}

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.

Guest
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.

Loading...
×
×
  • Create New...