Products module and multiple field value

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
kube
Forum Members
Forum Members
Posts: 29
Joined: Sun Jan 03, 2010 10:34 am
Location: Belgium

Products module and multiple field value

Post by kube »

Hi cmsms's people,

Here is a little problem i've been loosing hair with lately:

- In a product summary, i need to generate a list of related products to a specific product.
- So i have added a "related" product field. This field is a textfield.
- At this point i ca use this: fieldid="3" fieldval=$entry->id where 3 is designating the "ralted" field.

- Now, a product can be related to several others. So i was planning to use coma separated values in that field.
- That of course doesn't work...(well i didn't manage to get it working to be more precise) :'(

I am under the impression that this feature could be easily added to the Product module (by exploding the list in php and then generating the correct sql query. maybe add a specific attribute to the module ex: fieldvalues). Calguy ?

OR

maybe one of you Geniuses have a solution my blind mind cannot see ?
Please help my hair grow back again O0
maranc
Forum Members
Forum Members
Posts: 249
Joined: Tue May 04, 2010 5:04 pm

Re: Products module and multiple field value

Post by maranc »

Create your field caled "related". Enter id of related products using commas, example: "1,3,4" (when 1 or 3 or 4 are related products to the viewed product. Then inside detail template use following code:

{Products productlist=$entry->fields.related->value}

Best regards,
Marek A.
kube
Forum Members
Forum Members
Posts: 29
Joined: Sun Jan 03, 2010 10:34 am
Location: Belgium

Re: Products module and multiple field value

Post by kube »

Thx Marek,

However that works the opposite way of what i need:
- I have a list of specific services (products), say A
- I also have products (chemicals). I'll call those B
- The goal is when i display a A detail, i show a list of B products that are used in it. So the {product} call lies in the A view.
- There ar more B's than A's. So it will be easier to encode the services (A) that use the products in the products (B).

The way you do is quite the opposite as you propose to encode in A all B's that are used...

Yeah i know, it's wicked (so am i) :P
Post Reply

Return to “Modules/Add-Ons”