How get ADD TO CART event? (also Joomla or Javascript)

Phoca Cart - complex e-commerce extension
morphinestyle
Phoca Professional
Phoca Professional
Posts: 118
Joined: 19 Jan 2022, 19:55

How get ADD TO CART event? (also Joomla or Javascript)

Post by morphinestyle »

Hello,
how can i get an ADD TO CART event? (i'm using AJAX add to cart)

I take a look to https://www.phoca.cz/documents/116-phoc ... evelopment but there are only Joomla View Event.

Thank you very much.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How get ADD TO CART event? (also Joomla or Javascript)

Post by Jan »

Hi, in Phoca Cart there are no Javascript events, only standard Joomla events. But if you needs some Javascript event, you can write it in your site with customized Javascript. :idea: Or which event you exactly need? Will it affect JS and browser, or should this be some standard Joomla event which e.g. runs some Joomla plugin?
If you find Phoca extensions useful, please support the project
morphinestyle
Phoca Professional
Phoca Professional
Posts: 118
Joined: 19 Jan 2022, 19:55

Re: How get ADD TO CART event? (also Joomla or Javascript)

Post by morphinestyle »

SOLVED:
not founding anything :( i made a custom Javascript code to detect when chart is updated
morphinestyle
Phoca Professional
Phoca Professional
Posts: 118
Joined: 19 Jan 2022, 19:55

Re: How get ADD TO CART event? (also Joomla or Javascript)

Post by morphinestyle »

I made a custom override to turn Joomla System Messages into beautiful toast alerts, in this way i can have a more visible alerts over the rendered Joomla pages; i made fixed alert for WARNING and DANGER messages, and with an autoclose timeout for the INFO and SUCCESS messages.

In this way i can call my javascript function also for AJAX calls, and i have the same graphic design alerts with both standard Joomla Messages and my custom AJAX messages.

About ADD TO CAR event and my Phoca Cart: i was searching for a Phoca Cart event ADD TO CART, but at the end i made a custom JS run by a my custom Joomla plugin to detect #phItemCartBoxCount change (by MutationObserver), and in case of increment (added product) it runs my custom Joomla system alert to show "Add to cart".

So: Solved!
Thank you Jan!

(now i have some problem for product ATTRIBUTES operators --need percentage-- and how force MAIN IMAGE product --in place of ATTRIBUTE IMAGE-- on checkout page and checkout module in gantry menu module)

P.S.: there's a way to help you in developing? (i'm an italian graphic designer with HTML, PHP, CSS and Javascript skills)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How get ADD TO CART event? (also Joomla or Javascript)

Post by Jan »

(now i have some problem for product ATTRIBUTES operators --need percentage-- and how force MAIN IMAGE product --in place of ATTRIBUTE IMAGE-- on checkout page and checkout module in gantry menu module)
Can you write more detailed information? Or are these problems listed in other posts?
P.S.: there's a way to help you in developing? (i'm an italian graphic designer with HTML, PHP, CSS and Javascript skills)
If we are speaking about graphics, Phoca Cart just renders standard output - Bootstrap or UIkit. The biggest benefit for Phoca Cart in this sense would be some template which will support Phoca Cart.

Thank you, Jan
If you find Phoca extensions useful, please support the project
morphinestyle
Phoca Professional
Phoca Professional
Posts: 118
Joined: 19 Jan 2022, 19:55

Re: How get ADD TO CART event? (also Joomla or Javascript)

Post by morphinestyle »

Can you write more detailed information? Or are these problems listed in other posts?
Yes, about percentage multiplier it's in another post.
The biggest benefit for Phoca Cart in this sense would be some template which will support Phoca Cart.
Ok, i use only Gantry templates im my productions, let me know how i can contribute.
Post Reply