[Skip to main content](#vessel-content)

#   Get the cart quantity

##

- **[mcruip](/forum/user/12482-mcruip "View mcruip's Profile")**
- [![mcruip's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12482-mcruip "View mcruip's Profile") Topic Author
- [ Offline](/forum/user/12482-mcruip)

Less More

- Posts: 58
- Thank you received: 2
-
-

12 years 7 months ago [\#148082](#148082) by [mcruip](/forum/user/12482-mcruip "View mcruip's Profile")  *[Get the cart quantity](/forum/31-development/866606-get-the-cart-quantity#148082 "Hi,  We need to implement a small button that links to the checkout area. The button is a simple cart with the current cart total items next to it. How can this be achieved in a module?  Thanks M  Hika Business")* was created by *[mcruip](/forum/user/12482-mcruip "View mcruip's Profile")*

Hi,

We need to implement a small button that links to the checkout area. The button is a simple cart with the current cart total items next to it. How can this be achieved in a module?

Thanks
M

Hika Business

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NjYwNi1nZXQtdGhlLWNhcnQtcXVhbnRpdHk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

12 years 7 months ago [\#148103](#148103) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Get the cart quantity](/forum/31-development/866606-get-the-cart-quantity#148103 "Hi,  We need to implement a small button that links to the checkout area. The button is a simple cart with the current cart total items next to it. How can this be achieved in a module?  Thanks M  Hika Business")*

Hi,
Regarding the button, a simple Custom HTML module with the link to your checkout process will do the job but can you give me more information about that part :

> The button is a simple cart with the current cart total items next to it.

The following user(s) said Thank You: [mcruip](/forum/user/12482-mcruip "View mcruip's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NjYwNi1nZXQtdGhlLWNhcnQtcXVhbnRpdHk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mcruip](/forum/user/12482-mcruip "View mcruip's Profile")**
- [![mcruip's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12482-mcruip "View mcruip's Profile") Topic Author
- [ Offline](/forum/user/12482-mcruip)

Less More

- Posts: 58
- Thank you received: 2
-
-

12 years 7 months ago [\#148215](#148215) by [mcruip](/forum/user/12482-mcruip "View mcruip's Profile")  Replied by *[mcruip](/forum/user/12482-mcruip "View mcruip's Profile")* on topic *[Get the cart quantity](/forum/31-development/866606-get-the-cart-quantity#148215 "Hi,  We need to implement a small button that links to the checkout area. The button is a simple cart with the current cart total items next to it. How can this be achieved in a module?  Thanks M  Hika Business")*

Yes, a custom html like module is what we thought, but we need to add the user current car total next to it. Example:
Your cart: 5
In which 5 is the current total items currently in the cart.
The question is where do we get the cart object or cart quantity value.

Thanks!
M

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NjYwNi1nZXQtdGhlLWNhcnQtcXVhbnRpdHk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 7 months ago [\#148221](#148221) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Get the cart quantity](/forum/31-development/866606-get-the-cart-quantity#148221 "Hi,  We need to implement a small button that links to the checkout area. The button is a simple cart with the current cart total items next to it. How can this be achieved in a module?  Thanks M  Hika Business")*

Hi,

To get the cart data, you can see how we get it in the file "components/com_hikashop/views/product/view.html.php" in the "cart()" function: Code:

$class = hikashop_get('class.cart'); $cart_type = 'cart'; $cart_id =$app-&gt;getUserState( HIKASHOP_COMPONENT.'.'.$cart_type.'_id', 0, 'int' ); $class-&gt;get($cart_id,true,$cart_type); $full = $class-&gt;loadFullCart(true,true,true); $rows = $full-&gt;products;

Thanks to this code you will have the cart object in $full and the products in $rows.

The following user(s) said Thank You: [mcruip](/forum/user/12482-mcruip "View mcruip's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NjYwNi1nZXQtdGhlLWNhcnQtcXVhbnRpdHk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mcruip](/forum/user/12482-mcruip "View mcruip's Profile")**
- [![mcruip's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12482-mcruip "View mcruip's Profile") Topic Author
- [ Offline](/forum/user/12482-mcruip)

Less More

- Posts: 58
- Thank you received: 2
-
-

12 years 7 months ago [\#148344](#148344) by [mcruip](/forum/user/12482-mcruip "View mcruip's Profile")  Replied by *[mcruip](/forum/user/12482-mcruip "View mcruip's Profile")* on topic *[Get the cart quantity](/forum/31-development/866606-get-the-cart-quantity#148344 "Hi,  We need to implement a small button that links to the checkout area. The button is a simple cart with the current cart total items next to it. How can this be achieved in a module?  Thanks M  Hika Business")*

Thanks Xavier for the very useful guidance. That's the object we need to get the data and not break any other functionality.
Thank you
M

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NjYwNi1nZXQtdGhlLWNhcnQtcXVhbnRpdHk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.054 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
