Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejavascript
themeDJango
languagejavascript
linenumberstrue
<script type="text/javascript" src="https://secure.ultracart.com/cgi-bin/UCJavaScript?merchantid=DEMO&type=count"></script>

...

Code Block
languagejavascript
themeDJango
languagejavascript
linenumberstrue
<script type="text/javascript" src="https://secure.ultracart.com/cgi-bin/UCJavaScript?merchantid=DEMO&type=total"></script>

...

Return both as XML (mainly used in flash):

Code Block
languagejavascript
themeDJango
languagejavascript
linenumberstrue
<script type="text/javascript" src="https://secure.ultracart.com/cgi-bin/UCJavaScript?merchantid=DEMO&type=xml"></script>

...

Code Block
languagejavascript
themeDJangolanguagejavascript
linenumberstrue
<script type="text/javascript" src="https://secure.ultracart.com/cgi-bin/UCJavaScript?merchantid=DEMO&type=inventory&itemid=ITEMID"></script>

Replace the DEMO merchant ID with your own and ITEMID with the item that you want inventory information about.

Info
titleDisplay differences for merchants vs. customers

Please note that when you are viewing pages that have the "show inventory" script in them and you're viewing the page from the same browser in which you are logged into the UltraCart back-end, you'll see the inventory displayed with the Distribution Center code. The DC code that you will see in front of the inventory count will not appear to regular customers browsing the page.

 

If you have a custom SSL certificate, you should replace secure.ultracart.com in any of the above links with your secure host name.

...

Below is a simple example of the snippet of code that displays the customers current shopping cart details on your store web pages:

 

 

Code Block
languagejavascript
themeDJango
languagejavascript
linenumberstrue
<form method="post" action="http://secure.ultracart.com/cgi-bin/UCEditor">
  <input type="hidden" name="merchantId" value="DEMO" />
    <table class="uc-cart-summary" border="1">
    <tr class="uc-cart-summary-details">
      <td class="uc-cart-item-count-label">  <script type="text/javascript" src="https://secure.ultracart.com/cgi-bin/UCJavaScript?merchantid=DEMO&type=count"></script> | cart total: <script type="text/javascript" src="https://secure.ultracart.com/cgi-bin/UCJavaScript?merchantid=DEMO&type=total"></script> <input type="submit" name="submit" value="checkout" /> </td>
    </tr>
  </table>
</form>

...

Here is sample code using a custom cart image, replacing the form code with simple hyperlink:

 

 

Code Block
languagegroovy
themeDJangolanguagegroovy
firstline1
linenumberstrue
| Items: <script type="text/javascript" src="https://secure.ultracart.com/cgi-bin/UCJavaScript?merchantid=DEMO&type=count"></script> | Total: <script type="text/javascript" src="https://secure.ultracart.com/cgi-bin/UCJavaScript?merchantid=DEMO&type=total"></script> | <a href="http://secure.ultracart.com/cgi-bin/UCEditor?merchantId=DEMO"><img src="http://secure.ultracart.com/cgi-bin/UCGraphic?merchantId=DEMO&ThemeCode=Z&Filename=cart" name="Shopping Cart" width="25" height="23"></a> |

...