If you would like to build a "custom" cart for customers, without them having to make any selections in a widget, and bypass the first step of the checkout process you can use javascript to add item(s) to customer carts.

 A basic example adding a PLAN to the cart:

<script>
   $.post("[PAYWHIRL-SUBDOMAIN]/add-to-cart",{
        'type'   : "plan",
        'plan_id': 12345,
        'qty'    : 1

   }, function(data){

       //Redirect to Cart
       //<iframe src="[PAYWHIRL-SUBDOMAIN]/cart"><iframe>

   });
</script>


A basic example adding a PRODUCT, SERVICE or FEE to the cart:

<script>
   $.post("[PAYWHIRL-SUBDOMAIN]/add-to-cart",{
        'type'   : "product",
        'description': "My cool product",
        'amount' : 5.00,
        'qty'    : 1

   }, function(data){

       //Redirect to Cart
       //<iframe src="[PAYWHIRL-SUBDOMAIN]/cart"><iframe>

   });
</script>


Available Keys:

  • plan_id - Plan ID 
  • qty - Quantity 
  • amount - Price of item (optional when adding plans to the cart by id)
  • description - Name of item
  • type -  Product, Service or Fees 
  • sku - SKU of item

Please let us know if you have any questions!
Team PayWhirl

Did this answer your question?