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

#   Get cart class in Ajax function

##

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

Less More

- Posts: 42
- Thank you received: 3
-
-

4 years 1 month ago [\#345537](#345537) by [JF](/forum/user/67343-jf "View JF's Profile")  *[Get cart class in Ajax function](/forum/31-development/905151-get-cart-class-in-ajax-function#345537 "-- url of the page with the problem -- :   eduquay.satumalaysiahosting.com/booklist  Hi there,  I am facing an error which I unable to get cart class in my ajax function. (Previously worked BTW)  The attachments below are my ajax function and product listing.")* was created by *[JF](/forum/user/67343-jf "View JF's Profile")*

-- url of the page with the problem -- : [ eduquay.satumalaysiahosting.com/booklist](https://eduquay.satumalaysiahosting.com/booklist)

Hi there,

I am facing an error which I unable to get cart class in my ajax function. (Previously worked BTW)

The attachments below are my ajax function and product listing.

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

4 years 1 month ago [\#345540](#345540) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Get cart class in Ajax function](/forum/31-development/905151-get-cart-class-in-ajax-function#345540 "-- url of the page with the problem -- :   eduquay.satumalaysiahosting.com/booklist  Hi there,  I am facing an error which I unable to get cart class in my ajax function. (Previously worked BTW)  The attachments below are my ajax function and product listing.")*

Hi,

You're not loading HikaShop in your code. It's possible it will work if you have a system plugin of HikaShop loading HikaShop before your plugin is triggered by com_ajax, but it's only luck.
You should yourself load HikaShop before trying to use HikaShop with such code: Code:

if(!@include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')){ return false; }

That way, you're sure HikaShop is loaded before you try using it.

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

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

Less More

- Posts: 42
- Thank you received: 3
-
-

4 years 1 month ago [\#345633](#345633) by [JF](/forum/user/67343-jf "View JF's Profile")  Replied by *[JF](/forum/user/67343-jf "View JF's Profile")* on topic *[Get cart class in Ajax function](/forum/31-development/905151-get-cart-class-in-ajax-function#345633 "-- url of the page with the problem -- :   eduquay.satumalaysiahosting.com/booklist  Hi there,  I am facing an error which I unable to get cart class in my ajax function. (Previously worked BTW)  The attachments below are my ajax function and product listing.")*

Its worked, thanks!!!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwNTE1MS1nZXQtY2FydC1jbGFzcy1pbi1hamF4LWZ1bmN0aW9uP3RtcGw9bWFya2Rvd24=) 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.065 seconds

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