Ghostcart - Hosted PHP Shopping Cart

How to load the cart from an external page and link back to the referring page

GhostCart allows you to load your shopping cart from an external website and then use the "Continue Shopping" link to let users navigate back to the referring page so that they can select more products. You will find some examples to try lower on this page. You will be able to see how it works by viewing the source code for this page.

GostCart automatically generates the code for each product in your store. You can copy and paste it by opening the product add / edit form (product_add_form.php) for the product that you want to publish externally. At the bottom of the add / edit form, you will see a text area with code that you can embed in either a facebook business page or an external site.

To control the "Continue Shopping" link you will need to add one of the following hidden fields to your externally published products:

Return to the referring URL or any other URL:

<input type='hidden' name='cont_shop_url' value = 'https://www.YOUR_SITE.com/SOME_PHP_PAGE.php?value=$value' />

To keep the session data, the return page on your site must be a PHP or dynamic page that can obtain the session variable from the referring URL. Here is a PHP example:

<? $external_session_id = $_REQUEST['external_session_id']; ?>

Then make sure this hidden field is in all of your product forms (example assumes the referring page is .PHP):

<input type='hidden' name='external_session_id' value = '<? $external_session_id = $_REQUEST['external_session_id']; echo $external_session_id; ?>' />

To turn off the "Continue Shopping" link - as in cases where the external site is loading the cart in a popup window or when there is only one type of product being offered:

<input type='hidden' name='cont_shop_link' value = 'false'/>

Here is an example that includes a data collection form so that users can pre-fill their checkout data from the external site. Completing these fields are optional by default but AJAX validation can be added.



Tillys | Element T- Shirt
$38.50
Element T from Tillys



Place Your Order Today!
First Name:
Last Name:
Address:
City:
State:
Zip
Email:
Phone:



 



Tillys | Grey Flanel Shirt
$89.95
Marked as Two for 1 at Tilly's Nice Grey Flanel Shirt







Nordstrom | Black Dress
$198.00
Black Dress from Nordstrom