Jump to content

designfront

Member
  • Posts

    5
  • Joined

  • Last visited

designfront's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. hi all trying to count all items in my cart this is wht ime trying right now it works fine but if i add more of the same product it doesnt count it, how would i go about that? thanks in advance function render_mini_cart() { $shopping_cart = get_shopping_cart(); $product_count = 0; $items = $product_count; foreach ($shopping_cart->GetItems() as $product_id) { $product_count++; } echo "".$product_count." items"; }
  2. Hi all got it working not the best way it can be done i think but it works, i figured the reason it wasnt working is that the cart isnt empty and it isnt the default string length is 45 so i just said count the string length if its more than 45 then show the button and sure enough its working, now to count the total products in cart hehe, code below: function render_empty_cart_btn()//Checks if the cart is empty by counting the string length, if the string length is longer than the default length of 45 then it adds the empty cart button. { $cart = ($_SESSION['cart']); if(strlen($cart) > 45) { echo"Empty Cart "; }else{ echo" "; } }
  3. hey guys, got a problem, basically, on the shopping cart it has the three buttons. View products, > view basket and clear basket, even when the cart is empty a notification > message will be shown when u click empty basket. > > The link of the empty basket is= index.php?clear=1 > > And it gets processed by: > > if (isset($_REQUEST['clear'])) > > { > $shopping_cart->EmptyCart(); > echo render_notification(' Shopping Cart> Emptied ');> } > > And i wanted to add something like on where the actual link is like > > function check_if_empty($check_if_empty)){ > > If (empty($cart)){ > > $check_if_empty = ""; > > }else{ > > $check_if_empty = " and the link in here";> > } > > } > > And then just replace where the li used to be with the function variable, is > that a ok solution? But don't know whts wrong with the syntax not working, > > Many thanks > Andre Figueira
  4. yeah well i really need to get my cart working, and ime an unpatient guy lol, well wht else can i do hehe, cya
  5. Hi all ime new here, just bought the PHP shopping cart tutorials about an hour ago and i am still waiting for my download link on the my products page, i have already contacted stefan and the support email, but not answer, what should i do? Thanks
×
×
  • Create New...