|There may be issues with shopping cart integration.
This article will detail basic troubleshooting when integrating a shopping cart.
In order to troubleshoot a shopping cart, do the following:
- Request credentials for a partner’s shopping cart.
- Provide a test product for $0 with $0 cost for shipping. If you are unable to provide a $0 product, provide a test credit card number or a test mode link to bypass actual payment details.
- Verify their implementation includes SharpSpring page tracking code in the head of all pages of the cart.
- Verify the first thing triggered is the following call:
Questions for _setTransaction Calls
Q: Which fields are required in_setTransaction?
A: All fields are required, with the exception of
Q: If I do not know the total, tax, or shipping, can I leave it blank or null?
A. No. Use
‘0.00’ if it is not known yet. You can and should run
_setTransaction any time you have additional information or wish to update the totals.
Q: Is 'transactionID' the same as the order number?
A: It can be. The only requirement is that it is a unique number used for all three API calls. It can not change in the middle of the process. If your shopping cart can generate a unique order number right from the start, use it. But, if not, it must be some other number generated on your side to represent the transaction that cannot change.
Q: Is ‘storeName’ a value I should be getting from somewhere?
A: No, this is only used to store in SharpSpring's system and is not a key of any kind. This should be a human-readable, friendly label for your store. An example would be
‘Fruits and Nuts Shoppe’.
Q: Why am I running _setTransaction if I do not know any details yet, like a final order total?
A: This must be run first so that SharpSpring can establish the
transactionID for the potential order. You may run
_set Transaction during other steps to update the final order total (such as when someone adds a product to a cart, or finalizes their purchase). It should be run multiple times during the process.
Questions for _addTransactionItem Calls
Q: Which fields are required in _addTransactionItem?
A: All fields are required. This may not contain any
“$” or null or blank values.
Questions for _completeTransaction Calls
Q. When should I run _completeTransaction?
A. This should be the final call in code after the person checks out or otherwise pays, so it should be placed on the receipt page or final order confirmation page. It may be a good idea to rerun
_setTransaction prior to
_completeTransaction to ensure the final totals have been sent to SharpSpring.
Q: What transactionID should be used?
A: This should use the same
transactionID that has been used in the other two calls. Even if an order number has been generated by the cart, you must not use that and continue to use the
“Transaction” number used throughout the process. Consider the following:
'transactionID': '1234', (should be the same value used in _setTransaction call)
Q: When is the shopping cart unavailable?
A: The shopping cart is unavailable when a Salesforce Sync is active.
Q: What if the checkout page is hosted on another domain, subdomain, or it changes completely?
A: All pages during the process including the final order confirmation page must be trackable within SharpSpring. It is fine if it changes, but you must do the following:
- Set up each site in SharpSpring as a trackable site
- Put the tracking code in the header HTML
Additionally, the domain must be static. It can not be some randomly generated subdomain that you do not know in advance. This is because you must add the full domain as a trackable site inside of SharpSpring.
Example Code in Action
The following is example code for integration: