Page 1 of 1

Setting up custom fields for products

Posted: 14 Oct 2021, 09:57
by Picannick
Hi there,

I am sorry, if this question has already been answered, but I cannot find a solution. So maybe one of you can help us.

We want to create some custom fields (e.g. chechbox group or dropdownlist) with defined values, for example "Power: under 600 Watt, 600-1000 Watt, over 1000 Watt".
In the products you should be able to choose a value in the dropdown or checkboxgroup. The functionality shall be exactly as Joomla works with the article fields. We want to add a filter with this chosen values as well.

These values should not work as an option but like technical data. So like the specifications of each product, but I do not want to type it for every single product, but be able to choose from a predefined list of value. Can I reach this somehow? Maybe with Parameters and Parametervalues?

And if it is possible, then I also would like to be able to define a group of fields for a specific product category or subcategory, because different categorys need different extra fields.

I would be really pleased if somebody can help me,
Thankk you very much, kind regards
Picannick

Re: Setting up custom fields for products

Posted: 17 Oct 2021, 13:46
by jpeters
the only way i currently know.. create dummie product with the atributes.
Based on the dummie product create the product and use batch to copy the product details from the dummie.

Re: Setting up custom fields for products

Posted: 19 Oct 2021, 19:53
by Jan
Hi, yes, attributes are defined for each product, but parameters can be defined globally so you can select them in each product and not type for each product.

Jan

Re: Setting up custom fields for products

Posted: 22 Oct 2021, 17:29
by Picannick
Hi Jan,
thank you for your answer. I created the parameters I need and it works by now. Is it also possible to create a parameter as a textfield? So that you have this field in every product but can type in the value and not choose it from a dropdown?

Another question about the parameters:

I cannot find out how to tell the filter module only to filter the products in the active category and not to load all items (This would be really nice, because if you are in the category "Childrens clothes" and you filter by manufacturer, you dont want to see Women's or Men's clothes). And the option "Filter Category" doesn't help, because the filter nontheless loads a completely different page.

Because of this I want to integrate a javascript-based filter myself. Therefore I have to get the parameter values into the items_grid layout. Is there any way to get these values? I already tried d['parameters'] like it is for the tags but there is no result.

Re: Setting up custom fields for products

Posted: 24 Oct 2021, 23:41
by Jan
Hi,

- textfield - for now there is no such option :-(

Parameters are displayed only on item view (product detail page), so they are not loaded in category or items view.

They are loaded this way:

Code: Select all

PhocacartParameter::getParametersRendered((int)$id, 1);
where $id is the ID of product.

Jan