Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Finding out the number of items in the simple shopping cart

by

Tips and Tricks HQ Support Portal › Forums › Simple PayPal Shopping Cart › Simple Shopping Cart Tweaks › Finding out the number of items in the simple shopping cart

  • This topic has 5 replies, 3 voices, and was last updated 12 years, 6 months ago by wzp.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • July 21, 2010 at 6:34 am #1292
    amin007
    Participant

    The following function should do the job to calculate the number of items in the shopping cart:

    function simple_cart_total_itmes()
    {
    $total = 0;
    foreach ($_SESSION['simpleCart'] as $item)
    {
    $total ++;
    }
    return $total;
    }

    September 20, 2010 at 1:49 pm #22622
    roback
    Member

    Is this to find out the number of line items or the number of line items + quantity of each line item?

    Where would I put this function?

    I want to use it as a tool to discount the total based on how many individual items are ordered. with discounts increasing with each additional line item (up to 4)

    any suggestions?

    Rob

    September 21, 2010 at 1:40 am #22623
    amin007
    Participant

    This is to find out the number of line items.

    September 21, 2010 at 1:43 am #22624
    wzp
    Moderator

    So, if I had 4 cans of Chicken Noodle Soup, and 3 cans of Mushroom Roup; the number is 7, right?

    September 21, 2010 at 3:14 am #22625
    amin007
    Participant

    Nope, the number of line items in the cart would be 2. The total quantity would be 7 (I don’t know what to call this :)

    September 21, 2010 at 4:49 am #22626
    wzp
    Moderator

    I’m gonna try that reasoning the next time I use the 10 item express lane at the supermarket, LOL!

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • WP PDF Stamper Documentation
  • WP Photo Seller Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial
  • WP Photo Seller Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Download Monitor

Copyright © 2023 | Tips and Tricks HQ