SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2006
    Location
    Windsor, Berkshire
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Wordpress Custom Fields with multiple Key -> Value pairs

    Hi all,
    I'm wondering if someone can help me come up with a solution to a problem i'm struggling with. On a site I'm building there are tours. Each tour has a pricing structure. Some of the structures are the same (1 week - $100, 2 weeks - $200 etc) and some are completely different.

    What I feel like I need is a sort of multiple input custom field set up. So there would be a header of "Pricing", and then a Key input and a Value input. So I could put in "1 week - $100, 2 weeks - $200". This would also need to dynamically increase and decrease, as some only have one price, some have 6 prices and they want 3 different currencies!!

    What would be the best way to do this? I'm finding custom fields a little bit limited for this and I'm stuck for ideas of how to proceed!

    Many thanks in advance
    Check out my new blog - and let me know if you have any content suggestions (HTML5, CSS3, jQuery tutorials) - http://www.display-nun.co.uk

  2. #2
    SitePoint Addict
    Join Date
    Oct 2008
    Location
    Virtual World is my location
    Posts
    307
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    As far as my knowledge of WP goes, you can either use Custom Fields or Custom Taxonomies to achieve this. I agree that if there are more values, managing it might be an issue, so for adding content, I would suggest use some form plugin which allows dynamic row / column addition. You would need a 2 column dynamic field update which could then store the values to a single custom field and the same could be retrieved as per your requirement. With regards currencies I would suggest use some automated currency converter or you would need 3 column dynamic field (with one column storing the ISO values of currency codes) like USD etc.
    RecipesNext.com - recipes, kitchen queries, videos & more...
    BargainNext.com - coupons / deals / bargains / offers & more...

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2006
    Location
    Windsor, Berkshire
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the advice. I ended up using advanced custom fields plugin and then wrote some logic to strip the pricing based on comma or hyphen delimiters. Was difficult to implement but works great now!
    Check out my new blog - and let me know if you have any content suggestions (HTML5, CSS3, jQuery tutorials) - http://www.display-nun.co.uk


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •