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

Number of items in eStore Shopping Cart

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore General Questions › Number of items in eStore Shopping Cart

Tagged: number of items in the cart, short code to get cart total, wordpress menu

  • This topic has 16 replies, 5 voices, and was last updated 12 years, 7 months ago by amin007.
Viewing 15 posts - 1 through 15 (of 17 total)
1 2 →
  • Author
    Posts
  • July 28, 2010 at 9:48 pm #1576
    singhi
    Member

    Hi, i wann have a link on my page “Shoppingcart (3 items)” showing the number of items in the cart and linking to my shopping-cart-site. Is there a tag to get the number of items?

    And is it there a way to link to my shopping-cart-site with clicking “add to cart”.

    I have already searched a long time for answers.

    Appreciate you help!

    July 29, 2010 at 3:09 am #22854
    amin007
    Participant

    Use the following shortcode to display the number of items in the shopping cart:

    [wp_eStore_total_items_in_cart]

    Make sure you have the latest version of the eStore Extra Shortcodes plugin:

    http://www.tipsandtricks-hq.com/ecommerce/wp-estore-shortcodes-and-functions-reference-460

    July 29, 2010 at 11:43 am #22855
    singhi
    Member

    Thanks it is working now with extra-shortcode plugin.

    Is it there a way to link to my shopping-cart-site with clicking the “add to cart” button?

    Im using this Shortcode to show the button [wp_eStore:product_id:1:end] but it just adding the item and reloading the page. I wanna have it linked to my cart.

    July 30, 2010 at 1:11 am #22856
    wpCommerce
    Moderator

    You can specify a button link for your product which once clicked will take the customer to your shopping cart site. “Button link” field is under “Additional Product Details” of “Add/Edit Products”.

    July 30, 2010 at 4:58 am #22857
    amin007
    Participant

    check the “Automatic redirection to checkout page” option in the settings menu so it automatically takes the customer to the checkout page after they hit the “Add to Cart” button.

    July 30, 2010 at 4:15 pm #22858
    singhi
    Member

    Thanks, that helped.

    Another Issue

    My sidebar-text-widget with the Shortcode [wp_eStore_total_items_in_cart] is creating a warning in case of a new session with zero items in cart:

    “Warning: Invalid argument supplied for foreach() in /WWWROOT/173195/htdocs/wp-content/plugins/wp-cart-for-digital-products/eStore_cart.php on line 25”

    Have a look on my testsite:

    http://www.soma-christi.eu/fotogallerien/

    Never ending story;-) Cheers again!

    July 30, 2010 at 11:59 pm #22859
    wpCommerce
    Moderator

    You can use the shortcode on a post or page. If you want to use it in a widget you need to only call the PHP function for that. Try calling the following PHP function from your widget and see how it goes –

    <?php echo eStore_get_total_cart_item_qty(); ?>

    July 31, 2010 at 10:31 am #22860
    singhi
    Member

    Tried both shortcodes on a page but the warning is still there. Its not even “not working”. The count (0) of the cart shows up but creating the warning when the session is new. When i put a item in cart or deleting it again the warning disappears. You can try the shoppping cart on this site: http://www.soma-christi.eu/fotogalerien/lichtfotografie/sonnelicht/

    August 1, 2010 at 12:28 am #22861
    Ivy
    Member

    Hi Singhi, I tested this issue on the page you posted but I am not getting the warning. Can you please test this and let me know if you are still getting the warning?

    August 2, 2010 at 10:04 pm #22862
    singhi
    Member

    Hi Ivy, yes still getting the warning. Have a look on this screenshot: http://www.soma-christi.eu/screenshot.png

    The warning is just coming up if the session is new, meaning after you have added a item to cart the warning disappears and the cart works fine. You can see that by deleting your session-cookie.

    August 3, 2010 at 1:36 am #22863
    amin007
    Participant

    Please find the following code in the “eStore_cart.php” file:

    $total_items = 0;
    foreach ($_SESSION['eStore_cart'] as $item)

    Once you find it modify it to the following and that should do the trick:

    $total_items = 0;
    if(empty($_SESSION['eStore_cart']))
    {
    return $total_items;
    }
    foreach ($_SESSION['eStore_cart'] as $item)

    August 3, 2010 at 6:51 am #22864
    mudit.agarwal
    Member

    Hi amin007

    Will you be updating this <b>trick</b> in the next update also? OR do we have to add this manually?

    August 3, 2010 at 8:00 am #22865
    mudit.agarwal
    Member

    Hi,

    i want to show the number of item in the cart as a WordPress3.0 Menu Item. So i am setting following text as the navigation label.

    <br />
    <b><?php echo eStore_get_total_cart_item_qty(); ?></b> Item(s) in cart<br />

    But it is not working, it is only showing “Item(s) in cart” as the link( there is no number(items))

    August 3, 2010 at 1:12 pm #22866
    amin007
    Participant

    yes, I will be adding this to the plugin so you don’t have to manually edit it.

    Open the “eStore_cart.php” file and search for the following function in that file:

    eStore_get_total_cart_item_qty()

    If you can’t find that function that means you need to get an updated version of eStore for this cart item quantity feature.

    August 3, 2010 at 3:18 pm #22867
    singhi
    Member

    That was Helpful! Merci!

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 17 total)
1 2 →
  • 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 Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2023 | Tips and Tricks HQ