1

I'm trying to pair all my custom product entries to all my dealers with 2 extra fields per product: price per day and price per week. The condition is that all my products are paired to all my dealers in advance. So when adding a new dealer I would like to show a table or some sort listing with all my products with the 2 fields in different columns.

I've tried to do this with a static table (Super table plug-in) and sort of succeeded: I made a new field for my dealers with each field named after a product and the field type set to a normal table with 2 columns for my 2 fields. In my templates I would query based on my product name and match the correct row from my Super table field, but it just seems error prone and not managable.

Does anyone have any advice on how to implement this in a correct way?

1

I'm not sure I completely understand what you're trying to achieve, but maybe the Many to Many Field Type plugin does the trick?

| improve this answer | |
  • I've had a look at this plug-in and it seems to create a many-to-many relationship. But I'm looking for an all-to-all relationship. Every product should be automatically added as a relationship to every dealer for which each dealer can add their own prices. – Dirkv01 Feb 18 at 13:12
  • 1
    Hm, I understand what you need now. You need to add a value for each automatically related product. The 'correct' way would be to build a plugin or module for it. The plugin would provide a fieldtype, and the fieldtype would display a list of products, with an input field for each product. – Paul Feb 18 at 13:20
  • Thanks for the answer, creating a custom plugin with a new fieldtype provided me with the answer I was looking for! – Dirkv01 Feb 20 at 10:09
  • If you only use it for one site, make it a module! – Paul Feb 20 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.