Documentation You are here: start » v » 1.0 » javascript

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v:1.0:javascript [2012/11/05 21:51] – Putting this in the right place 68.53.96.26v:1.0:javascript [2017/04/26 07:02] (current) – external edit 127.0.0.1
Line 35: Line 35:
  
 ===== How It Works & Configuration ===== ===== How It Works & Configuration =====
-While most of this should happen automatically, especially if you're using the ''foxycart.js'' or ''foxycart.complete.js'' versions (as opposed to the ''foxycart.raw.js''), there are a few things that need to be configured correctly.+While most of this should happen automatically, especially if you're using the ''foxycart.js'' or ''foxycart.colorbox.js'' versions (as opposed to the ''foxycart.raw.js''), there are a few things that need to be configured correctly.
  
 ==== ''storedomain'': How Your Links and Forms Are Handled ==== ==== ''storedomain'': How Your Links and Forms Are Handled ====
Line 124: Line 124:
  
  
-If you want to keep the colorbox modal implementation and extend with custom events be sure to include ''foxycart.colorbox.js'' after ''foxycart.js'' and any ''fcc'' customization after that: +If you want to keep the colorbox modal implementation and extend with custom events be sure to add any ''fcc'' customization after that. (You don't need to include both ''foxycart.js'' and ''foxycart.colorbox.js'', as ''foxycart.colorbox.js'' has the entirety of ''foxycart.js'' inside of it already.) 
-<code html><script src="//cdn.foxycart.com/YOURDOMAIN/foxycart.js" type="text/javascript" charset="utf-8"></script> +<code html><script src="//cdn.foxycart.com/YOURDOMAIN/foxycart.colorbox.js?ver=2" type="text/javascript" charset="utf-8"></script>
-<script src="//cdn.foxycart.com/YOURDOMAIN/foxycart.colorbox.js?ver=2" type="text/javascript" charset="utf-8"></script>+
 <script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
 fcc.events.cart.preprocess.add(function(e, arr) { fcc.events.cart.preprocess.add(function(e, arr) {
Line 235: Line 234:
 ==== ''postprocess'': After the Add-To-Cart ==== ==== ''postprocess'': After the Add-To-Cart ====
 === What It Is === === What It Is ===
-The ''postprocess'' event is //not called directly// by ''foxycart.js'', but is available to use if you need it. This can be useful, for example, if you want to refresh the ''FC.json'' when your modal window is closed, as is the case with the default ''foxycart.complete.js''.+The ''postprocess'' event is //not called directly// by ''foxycart.js'', but is available to use if you need it. This can be useful, for example, if you want to refresh the ''FC.json'' when your modal window is closed, as is the case with the default ''foxycart.colorbox.js''.
 === How It Works: Overview === === How It Works: Overview ===
 Just like the ''preprocess'' and ''process'', you can add multiple functions to the ''postprocess'' even. Notice the call to ''postprocess'' in the ''process'' example above, in the ''onClosed'' parameter. That's telling Colorbox to run the ''postprocess'' events when the modal window is closed. If we add a function like below, then the ''cart_update()'' method will be called (which refreshes the ''FC.json'' and updates the "minicart" helper functions). Just like the ''preprocess'' and ''process'', you can add multiple functions to the ''postprocess'' even. Notice the call to ''postprocess'' in the ''process'' example above, in the ''onClosed'' parameter. That's telling Colorbox to run the ''postprocess'' events when the modal window is closed. If we add a function like below, then the ''cart_update()'' method will be called (which refreshes the ''FC.json'' and updates the "minicart" helper functions).

Site Tools