VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Agaton on August 29, 2019, 17:20:21 PM

Title: Custom addtocart function query?
Post by: Agaton on August 29, 2019, 17:20:21 PM
Hi,

I want to be able to create a notice on the product details page when the add to cart button has been clicked.


My question is, what php code/array/function would I need to use to be able to get the information to display in the product details page?
Is it a cart session/cookie or php array that I need to work with, this is really an area I don't touch much!

I really do not know where to begin and some pointers would be welcome, I don't need this written in full for me, just a starting point.

Cheers
Martyn
Title: Re: Custom addtocart function query?
Post by: PRO on August 29, 2019, 20:36:31 PM
assets/vmprices.js

This
Virtuemart.addtocart = function (e)
then
Virtuemart.productUpdate = function()


are you NOT using the minicart module? or the pop up?


Title: Re: Custom addtocart function query?
Post by: Agaton on August 29, 2019, 20:47:01 PM
Sorry I don't think I made myself clear.

I want the number of that product only to be displayed under the add to cart button like this website...

https://www.cartridgesave.co.uk/ink-cartridges/Brother/DCP-197C.html

click add to basket and see what happens that's exactly what I am after

I just need to know what variable/array/session or other code I need to work from to make this possible. Thanks in advance.
Title: Re: Custom addtocart function query?
Post by: Studio 42 on August 29, 2019, 21:26:53 PM
Session ?
You can override core javascript in your template to replace the popup and update only the button.
To do this check
Quote from: PRO on August 29, 2019, 20:36:31 PM
assets/vmprices.js

This
Virtuemart.addtocart = function (e)
then
Virtuemart.productUpdate = function()


are you NOT using the minicart module? or the pop up?



Title: Re: Custom addtocart function query?
Post by: Agaton on August 30, 2019, 08:55:09 AM
Thanks, Javascript is my start them in that asset file

By session I was referring to cookie sessions, as I said I had no idea where to start.