is it possible to add Shipping and Taxes in the cart form?

austinbizmartaustinbizmart Member
in Help edited November 2013
Hi,
If I want to send our customer directly to the checkout, by automatically submitting a cart form, is there any parameter to add a global shipping and tax ?
So the customer only has to register or login and just pay,
<form action="http://yourdomain.foxycart.com/cart"; method="post" accept-charset="utf-8" class="foxycart">
	<input type="hidden" name="name" value="Example T-Shirt" />
	<input type="hidden" name="code" value="abc123" />
	<input type="hidden" name="price" value="25" />
        <input type="hidden" name="shipping" value="100" /> <!-- does a total shipping parameter exist? -->
        <input type="hidden" name="tax" value="100" /> <!-- does a total tax parameter exist? -->
	<p><input type="submit" value="Buy It! &rarr;"></p>
</form>

Thanks
Comments
  • winstonwinston FoxyCart Team
    @austinbizmart

    There's no shipping and tax parameters built in, those are all handled either globally or on the category level, instead of at the product level. All parameters available are here: https://wiki.foxycart.com/v/1.1/products

    If you set category shipping to be flat rate that will reduce the options for that step. Are you trying to remove the shipping information itself, or just reduce time to checkout by not waiting on tax/shipping ajax?
  • @winston

    Well, one of our scenarios is that we create an invoice for our customers and we have everything already calculated. So we're skipping the cart entirely. And we want foxycart to behave as a payment processor in this scenario.

    So I've managed to do this by using custom fields, then on the template checkout I've adjusted the shipping and taxes.
    <!DOCTYPE html>
    <html>
        <body>
            <span>Generating Checkout Page...</span>
            <form name="foxycart" action="https://yourdomain.foxycart.com/cart"; method="post">
                    <input type="hidden" name="name" value="ABC" />
                    <input type="hidden" name="code" value="123" />
                    <input type="hidden" name="quantity" value="1" />
                    <input type="hidden" name="price" value="1000" />
                <input type="hidden" name="empty" value="true" />
                <input type="hidden" name="h:shipping" value="100" />
                <input type="hidden" name="h:tax" value="10" />
                <input type="hidden" name="h:order_id" value="10" />
                <input type="hidden" name="cart" value="checkout" />
                <input type="submit" name="generate" value="" />
            </form>
        <script>
            document.foxycart.submit();
        </script>
        </body>
    </html>
    

    Thanks for advice.
  • fc_adamfc_adam FoxyCart Team
    Just a quick heads up - you can't set tax values on the checkout and have them stick - you'll need to do taxes natively, or add them as an actual product line item in the cart. You could also roll the tax cost into the shipping cost and do it that way.
Sign In or Register to comment.