Add to cart

nate
@nate
10 years ago
917 posts
I need to make a js function to add an audio file to the shopping cart. This will be called from a flash player. I've looked for code to try to copy but haven't seen what I'm looking for.
updated by @nate: 02/25/16 12:06:49AM
michael
@michael
10 years ago
7,791 posts
From a template, the function your probably looking for is {jrFoxyCart_add_url}

its smarty_function_jrFoxyCart_add_url() at /modules/jrFoxyCart/include.php around line 1500 ish.

Something like this:
{jrFoxyCart_add_url module="jrAudio" item=$item field="audio_file"}

Might be easier to setup a module to handle the getting of the $item inside a module function then get call a url to fire that function via ajax to get back the info you need perhaps json formatted.

So your flash player executes an ajax call to a defined url
site.com/your-module/get_url/audio_file/1

and the modules function view_n8YourModule_get_url() function fires that jrFoxyCart_add_url() function and returns back the URL your after.
nate
@nate
10 years ago
917 posts
michael:
From a template, the function your probably looking for is {jrFoxyCart_add_url}

its smarty_function_jrFoxyCart_add_url() at /modules/jrFoxyCart/include.php around line 1500 ish.

Something like this:
{jrFoxyCart_add_url module="jrAudio" item=$item field="audio_file"}

Might be easier to setup a module to handle the getting of the $item inside a module function then get call a url to fire that function via ajax to get back the info you need perhaps json formatted.

So your flash player executes an ajax call to a defined url
site.com/your-module/get_url/audio_file/1

and the modules function view_n8YourModule_get_url() function fires that jrFoxyCart_add_url() function and returns back the URL your after.

The js file was the plan. Thanks.

Tags