Documentation You are here: start » v » 0.7.2 » 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:0.7.2:javascript [2012/03/27 00:05] – [''postprocess'': After the Add-To-Cart] Fix Type sparkwebv:0.7.2:javascript [2017/04/26 07:02] (current) – external edit 127.0.0.1
Line 73: Line 73:
   * ''#fc_total_price'', ''.fc_total_price'': The inner HTML will be replaced by the value in ''FC.json.total_price'', formatted using the ''_currency_format'' function (which adds decimals but doesn't add currency symbols).   * ''#fc_total_price'', ''.fc_total_price'': The inner HTML will be replaced by the value in ''FC.json.total_price'', formatted using the ''_currency_format'' function (which adds decimals but doesn't add currency symbols).
  
 +<code html><a href="https://yourdomain.foxycart.com/cart?cart=view" id="fc_minicart">
 + My Cart: <span id="fc_quantity">0</span> - <span id="fc_total_price">$0.00</span>
 +</a></code>
 ==== ''session_get'' Appending the FCSID to Requests ==== ==== ''session_get'' Appending the FCSID to Requests ====
 === What It Is === === What It Is ===
Line 100: Line 103:
  
 The ''fcc.session_get()'' call will return something like ''&fcsid=abc123su2eoba8r9oknf7qa4b3''. If you just need the ''fcsid'' value itself you can easily retrieve it from the ''JSON'' with ''FC.session_id''. The ''fcc.session_get()'' call will return something like ''&fcsid=abc123su2eoba8r9oknf7qa4b3''. If you just need the ''fcsid'' value itself you can easily retrieve it from the ''JSON'' with ''FC.session_id''.
 +
 +<wrap important>Developer Note:</wrap> if you are developing with Chrome and on an IP address, Chrome won't let you save cookies to that IP or to localhost so it's best to do any session_get() calls with another browser during development. [[http://code.google.com/p/chromium/issues/detail?id=56211]]
  
 <wrap important>Are you **//creating//** or **//modifying//** elements?</wrap> If you're dynamically //creating// add-to-cart links or forms, you don't need to bother with this at all. It will be handled automatically. If however you're //modifying// the ''href'' of an add-to-cart link that was present on pageload you //do// need to append the ''fcsid''. This has to do with how FoxyCart binds ''onclick'' handlers to elements while also making it easy to add new add-to-cart link or form elements. <wrap important>Are you **//creating//** or **//modifying//** elements?</wrap> If you're dynamically //creating// add-to-cart links or forms, you don't need to bother with this at all. It will be handled automatically. If however you're //modifying// the ''href'' of an add-to-cart link that was present on pageload you //do// need to append the ''fcsid''. This has to do with how FoxyCart binds ''onclick'' handlers to elements while also making it easy to add new add-to-cart link or form elements.

Site Tools