Tips and Tricks HQ Forum

Support Forum for Tips and Tricks HQ Products

Register or log in - lost password? (Having an issue with the forum login?)

Search the Forum

Tips and Tricks HQ Forum » Simple PayPal Shopping Cart » Simple Shopping Cart Tweaks

Finding out the number of items in the simple shopping cart

(6 posts) (3 voices)
  • Started 1 year ago by amin007
  • Latest reply from wzp
  • Possible Solutions (Related Topics):
    1. Coupon is deviding discount amount by the number of items in the shopping cart.
    2. Number of items in eStore Shopping Cart
    3. Items in shopping cart - incorrectly totaled
    4. Display text link to shopping cart only when items are in cart
    5. How to Customize or Change the Buy Button Images for eStore

Tags:

No tags yet.

  1. amin007
    Key Master

    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;
    }
    Posted 1 year ago #
  2. roback

    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

    Posted 1 year ago #
  3. amin007
    Key Master

    This is to find out the number of line items.

    Posted 1 year ago #
  4. wzp
    Moderator

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

    Posted 1 year ago #
  5. amin007
    Key Master

    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 :)

    Posted 1 year ago #
  6. wzp
    Moderator

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

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Tips and Tricks HQ  | WP Shopping Cart  | WP Affiliate Software  | WordPress Membership Plugin