Search

Hello all,

I've used Symphony for a couple of projects before, but right now I'm hitting a wall and I was wondering whether anybody could point me to some direction I cannot see.

I'm trying to build a backend interface for a takeaway, and basically I need two entries: the dish and the price.

The complication is that the price varies with the size, so for example a 10'' pizza has a different price than a 12'' pizza. Since not all dishes have a size, and not all dishes have the same type of size (some have dimensions, some are just defined as small/medium/large), I am struggling to find a way to make it so that if a size is selected (I wouldn't have a problem with a drop-down list with sizes) then more price entries are displayed, and of course each price should be in relationship (parent-child?) with the size.

I suppose I might be taking this from the wrong angle, and maybe I should spread my entries under more sections, but so far nothing I have thought of seems to make sense...

I would be very grateful if anybody could give me even just a little hint that can open up my mind.

Thanks for your time :)

Well, you need the Sizes section as well.

In your Pizza entry you will then select the Size from a dropdown (SBL to Sizes) and the Price from a dropdown (SBL to Prices).

Thanks for your input. That seems to make sense, however having the prices in a drop down list does not seem to be very practical... the ideal would be being able to just type it in right in the Pizza entry.

But I'll try to play around with that. Thanks a lot :)

EDIT: Also, how would I go around adding more sizes to a single entry? Some entries don't have a size, some may have 2, some more than 2. That is my main difficulty.

Create another section X that stores relations between Sizes and Prizes:

  • SBL+ / SSM to Sizes
  • Number field - Price (if you don't want another section for Prices)
  • Reflection field to cancatenate the 2 above (nicely display)

In Pizza link to Reflection field from X via SBL+ or SSM. If there's need for more than 1 size, just create another entry in X.

Have you considered Meta Keys?

Thank you both for your suggestions. I think I'll have a go with Meta Keys first, as they seem to offer the most immediate solution so far. I will consider the more complex solution if this one falls short somehow :)

I'll update this post as soon as I build something that is functional, so that I can test this more thoroughly.

Thanks again :)

So, after fiddling around, I settled with the Meta Keys. The only thing that I'd really love though is the possibility to change the labels of the keys, i.e. "key" and "value". I would rename them to "size" and "price" obviously.

Thanks, you've been very helpful :)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details