The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

price and shipping based on user status

drwagner13drwagner13 Member
in Help edited November 2008
The prices in our company are based on two things: customer location (inside the US, or not), and membership status (society member, or not).

For one set or products, we have two prices per item, one for foreign and the other for domestic.

For another set of products, was have a member price and a non-member price, with flat rate shipping determined by domestic/foreign.

I'm looking for a good way to store and retrieve this information. I can require the visitor to fill out a simple form before ordering and then set cookies, for instance. But I don't currently know how to retrieve this information in a meaningful way to inset into a price field. Ideas?
  • brettbrett FoxyCart Team
    You're not using any sort of CMS, right?

    The solution to your question will require some sort of dynamic functionality, like PHP with some sort of database (or, conceivably, flat file, maybe use PHP's serialization function) holding the pricing. Or a single file on your server with an associative might actually be the easiest. (I'm going to assume PHP since that's probably the most "standard" for most hosting environments.)

    The form-before-order would work to quickly and easily to determine which prices to display, but the prices themselves would need some server side programming. (You could do it with javascript, but it'd probably be slower.)

    So, rather than hardcoding the price in your HTML, just call the PHP function to check the cookie and output the correct price, based on the hash (that you'd do a php include with). <input name="price" value="<? my_function('product_id', $cookie_value); ?>" />

    Does that help?
  • I'm using ModX. I can store the prices as chunks, I suppose. I just need to delve into how to set and retrieve cookies. Here goes another day of drudgery... Is this fun? OK, it's a little bit fun ;)
Sign In or Register to comment.