Categories and category arrays

Hello again.

I'm back modifying my pre-order app. The requested upgrade is the ability for venues to offer both pick-up and/or delivery of food and drink items (whereas before only pick-up was allowed.) If the venue allows for delivery, the admin can also set a delivery fee that would be applied should the customer choose 'delivery' as the dispatch method.

I already have a few categories set for taxes (venues are in different states and also do charitable functions, so various tax methods are required.) Now, of course, I would need to set-up something to deal with the delivery fee (which changes according to the venue and whether or not the customer has selected 'delivery'). The delivery fees, of course, would be flat-fees, applied to the order not the items, but would vary depending upon the venue (an ID variable that I am sending along with the item data.)

My questions to you are:

1. I know that I can set-up a category with a flat-fee delivery charge but I see that there is also a fee entry in the form; can I override the form with session or POST variables in the cart data transmission or am I limited to the flat fee entered in the category form?

2. If I can override the form above, is there a way to trigger multiple categories (as an array of categories,) or will I have to create a new category for each possibility (i.e.: no delivery fee but New York tax, delivery fee and New York tax, no delivery fee but Connecticut tax, deliver fee and Connecticut tax, etc...)

3. If neither of the above, do you have a suggestion as to the best way that I can achieve what I am looking to do? I am currently using your default check-out; will I have to build a custom check-out page so that I can do the logic on my own?
Comments
  • fc_adamfc_adam FoxyCart Team
    @swinginsam,

    Good question. For what you're describing, I'd actually recommend you take a look at our recently added custom shipping endpoint functionality. What this does is whenever a customer enters their shipping address, FoxyCart will send off a request to an endpoint on your server with the cart and address information. You can then calculate any rates you need to return back to the checkout for the customer to select. You can see an overview of it here: https://wiki.foxycart.com/v/2.0/shipping#custom_shipping_endpoint
  • Hey, now, this looks ever-so-slightly like awesome. From the documentation, it looks as though the only real tricky part will be to customise the wording so that it looks a little less like 'shipping' and more like 'delivery'.

    I'll check it out and tell you how I do.

    Thanks, Adam.
  • fc_adamfc_adam FoxyCart Team
    @swinginsam,

    You can customise any customer facing language strings from the "language" section of the administration for your store. Then within your custom endpoint you also set what the labels are for the rates that are returned. With that combined you can certainly switch it out to be "delivery" instead of "shipping".
  • I was just looking at that!

    I'm currently setting up a duplicate store to run DEV from so that I don't break the live app. From there, it should just be a matter of updating my already existing controller (from the postback) with a little logic from the model output, a tweak in the language as you said, and I should be good to go.

    Fingers: crossed.
  • fc_adamfc_adam FoxyCart Team
    @swinginsam,

    Great game plan - let us know if we can help with anything else!
  • Got it working.

    I'll find out where the holes are once people try to break it in beta.

    Eventually I'll have to go with a custom checkout as I need more control over what is shown, when. For example: the delivery address fields are now always shown even for the pickup dispatch. (I am assuming) this is because all of my categories are now set to live shipping rates. This could be confusing for some customers as the bulk of the transactions will still be 'pickup'.

    I suppose that I could go through and add/alter the categories (as I said before,) so that there are pickup and custom live rate options for each of my tax categories but, for now, this will have to work.

    Thanks again for the help.
Sign In or Register to comment.