Total Number of Items in Cart

Permalink Browser Info Environment
Hello,

I want to add a counter in the Cart icon, and I was wondering if the system keeps track of total items in cart. Is there a variable set up for that? I just need to understand how to access it in a header item.

Thanks,
Craig

Type: Discussion
Status: In Progress
vergedesign
View Replies:
fabianbitter replied on at Permalink Reply
fabianbitter
Hello,

please try:

echo count(\Bitter\ShopSystem\ShoppingCart::getInstance()->getAll());
vergedesign replied on at Permalink Reply
vergedesign
Exactly what I needed. Thank you!

concrete5 Environment Information

# concrete5 Version
Core Version - 8.4.5
Version Installed - 8.4.5
Database Version - 20180717000000

# concrete5 Packages
Backup Pro (3.4), Bitter Shop System (1.2.5), Block Designer (3.2.1), Block Designer Pro (3.0.0), ExchangeCore reCAPTCHA (1.1.1), Extreme Clean (7.1.1)

# concrete5 Overrides
blocks/express_entry_list/templates/bss_product_list/view.php, blocks/express_entry_list/templates/bss_product_list, blocks/express_entry_list/templates, blocks/express_entry_list, blocks/express_entry_detail/templates/bss_product_detail/view.css, blocks/express_entry_detail/templates/bss_product_detail/view.js, blocks/express_entry_detail/templates/bss_product_detail/view.php, blocks/express_entry_detail/templates/bss_product_detail, blocks/express_entry_detail/templates, blocks/express_entry_detail, elements/express/form/form/form.php, elements/express/form/form, elements/express/form, elements/express, elements/system_errors.php, elements/shop/checkout/ajax/summary-bak.php, elements/shop/checkout/ajax, elements/shop/checkout/payment_providers/credit_card.php, elements/shop/checkout/payment_providers, elements/shop/checkout, elements/shop/product_list/item.php, elements/shop/product_list, elements/shop, attributes/category/type_form.php, attributes/category, mail/block_form_submission.php, mail/block_express_form_submission.php, single_pages/login.php, single_pages/register.php, single_pages/dashboard/bitter-shop-system/settings.php, single_pages/dashboard/bitter-shop-system, single_pages/dashboard, single_pages/shop/checkout/summary.php, single_pages/shop/checkout/one_page.php, single_pages/shop/checkout/one_page-cm.php, single_pages/shop/checkout, single_pages/shop/shopping_cart.php, single_pages/shop, themes/beaditudes/sidebar_right.php, themes/beaditudes/ck-icon.png, themes/beaditudes/page_theme.php, themes/beaditudes/config.codekit3, themes/beaditudes/home.php, themes/beaditudes/img/icon-search.svg, themes/beaditudes/img/logo-full.svg, themes/beaditudes/img/fpo-banner-1.png, themes/beaditudes/img/icon-cart.svg, themes/beaditudes/img/icon-ios.png, themes/beaditudes/img/logo-mark.svg, themes/beaditudes/img/home-banner-lg-2.jpg, themes/beaditudes/img/home-banner-lg-1.jpg, themes/beaditudes/img/home-banner-sm-2.jpg, themes/beaditudes/img/home-banner-sm-3.jpg, themes/beaditudes/img/icon-win.png, themes/beaditudes/img/home-banner-sm-1.jpg, themes/beaditudes/img/icon-fav.png, themes/beaditudes/img/home-banner-1.png, themes/beaditudes/img/home-banner-lg-3.jpg, themes/beaditudes/img, themes/beaditudes/interior.php, themes/beaditudes/page_not_found.php, themes/beaditudes/blog.php, themes/beaditudes/inc/nav.php, themes/beaditudes/inc/header-home.php, themes/beaditudes/inc/header_top.php, themes/beaditudes/inc/header_home.php, themes/beaditudes/inc/scripts.php, themes/beaditudes/inc/footer.php, themes/beaditudes/inc/footer_bottom.php, themes/beaditudes/inc/header.php, themes/beaditudes/inc, themes/beaditudes/js/validate.js, themes/beaditudes/js/bootstrap.min.js, themes/beaditudes/js/scripts.js, themes/beaditudes/js/zenscroll-min.js, themes/beaditudes/js/gs-anim.js, themes/beaditudes/js/gs-examples.js, themes/beaditudes/js/mask.js, themes/beaditudes/js/animation-gsap.js, themes/beaditudes/js/jquery.stellar.min.js, themes/beaditudes/js/waypoints.min.js.zip, themes/beaditudes/js/arrive.min.js, themes/beaditudes/js/waypoints.min.js, themes/beaditudes/js, themes/beaditudes/thumbnail.svg, themes/beaditudes/scss/_error.scss, themes/beaditudes/scss/_branding.scss, themes/beaditudes/scss/_responsive.scss, themes/beaditudes/scss/_login.scss, themes/beaditudes/scss/_utils.scss, themes/beaditudes/scss/_init.scss, themes/beaditudes/scss/_shop.scss, themes/beaditudes/scss/_home.scss, themes/beaditudes/scss/_shared.scss, themes/beaditudes/scss/styles.scss, themes/beaditudes/scss/_search.scss, themes/beaditudes/scss/_forms.scss, themes/beaditudes/scss/_normalize.scss, themes/beaditudes/scss, themes/beaditudes/full.php, themes/beaditudes/view.php, themes/beaditudes/page_forbidden.php, themes/beaditudes/thumbnail.png, themes/beaditudes/shop_grid.php, themes/beaditudes/css/styles.css, themes/beaditudes/css/styles-bak.css, themes/beaditudes/css, themes/beaditudes

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
7.0.33

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, intl, json, libxml, mbstring, mcrypt, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, readline, Reflection, session, SimpleXML, soap, sockets, SPL, sqlite3, standard, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 3000M
post_max_size - 2000M
sql.safe_mode - Off
upload_max_filesize - 1000M
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.