News:

Looking for documentation? Take a look on our wiki

Main Menu

custom field for selection

Started by Naturt, July 26, 2013, 09:59:55 AM

Previous topic - Next topic

Naturt

Hi there! I upload product packages (ex.: 1 product package contains 4 types of other products). You can pick your package whatever you want.
Ex.: 2a + 2b, or 1a, 2b, 1c, or 1a, 1b, 1c, 1d and so on.
How can it solve with custom fields? The package price is constant, no mather what 4 product is containted.

Thanks in advance

Maxim Pishnyak

What is the problem? You don't allow customers to buy more then four products at once?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

Naturt

No, sorry for my english.
So this package is uploaded as a product. I want to the ability to collect your own 4 product in your package, as your wish. The package price does not change, only the contents.

Maxim Pishnyak

Four custom fields in one product (package).
Each custom field has the same variants: a,b,c,d.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

Naturt

But what type of custom field? I want a product name and a quantity field

Maxim Pishnyak

field1: a
field2: a
field3: b
field4: b
I see that customer wants two a and two b. I.e. 2a+2b.

You need custom field that will be shown in cart ofc. There's only one with such ability.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

Naturt

It is near ok, but the product names are too long and complex, nobody will type down twice (2a)

Maxim Pishnyak

Quote from: Naturt on July 26, 2013, 16:53:02 PM
It is near ok, but the product names are too long and complex, nobody will type down twice (2a)
Give me a link where you followed my advice and we'll see what is long and what is complex, ok?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

PRO

so package price does NOT change with the  selections they choose?
I dont understand how you are having a problem with this?

IF the way the build the package effects the price.

Then sometimes you can do- this with custom fields,
and sometimes you would need something like this
http://breakdesigns.net/virtuemart-product-builder

so explain further



Naturt

Thanks for the answers, the solution is "Four custom fields in one product (package). Each custom field has the same variants: a,b,c,d."  by Maxim Pishnyak. Sorry, it is take a long time to realize this. And if i made a template override, how i can e-mail the custom fields values to the customer?
In the override i have this:

foreach ($product->customfieldsCart as $field)
              {
echo "<span style='margin-left:0px;'>".JText::_($field->custom_title).":</span>";
echo "<span style='margin-left:2px;'>".$field->display."</span>";
echo "<span style='margin-left:5px;'>".$field->custom_field_desc."</span>";
}

How can I reach the selected value(s) from the $field variable?

PRO

Quote from: Naturt on July 30, 2013, 14:21:07 PM
Thanks for the answers, the solution is "Four custom fields in one product (package). Each custom field has the same variants: a,b,c,d."  by Maxim Pishnyak. Sorry, it is take a long time to realize this. And if i made a template override, how i can e-mail the custom fields values to the customer?
In the override i have this:

foreach ($product->customfieldsCart as $field)
              {
echo "<span style='margin-left:0px;'>".JText::_($field->custom_title).":</span>";
echo "<span style='margin-left:2px;'>".$field->display."</span>";
echo "<span style='margin-left:5px;'>".$field->custom_field_desc."</span>";
}

How can I reach the selected value(s) from the $field variable?


you are not doing this the way you should.

http://forum.virtuemart.net/index.php?topic=90833.msg298101#msg298101

have you tried the regular virtuemart custom fields?


Naturt

Yes, i tried it, but i have a custom override with some unique code and a mail.php which is responsible for the mail to the admin and user. This e-mail is contains $product-> and $userContact-> variables, but i can't display the choosen custom field value.

Naturt

I tried send the selected custom field value in the mail.php this way:

foreach ($product->customfieldsCart as $field)
{
echo $field->custom_value;
}

But this is send me all values...

Maxim Pishnyak

Quote from: Naturt on July 30, 2013, 14:21:07 PM
Thanks for the answers, the solution is "Four custom fields in one product (package). Each custom field has the same variants: a,b,c,d.". Sorry, it is take a long time to realize this.
Quote from: PRO on July 30, 2013, 18:17:27 PM
you are not doing this the way you should.
http://forum.virtuemart.net/index.php?topic=90833.msg298101#msg298101
have you tried the regular virtuemart custom fields?
Quote from: Maxim Pishnyak on July 26, 2013, 18:24:17 PM
Quote from: Naturt on July 26, 2013, 16:53:02 PM
It is near ok, but the product names are too long and complex, nobody will type down twice (2a)
Give me a link where you followed my advice and we'll see what is long and what is complex, ok?
It's hard to judge without working link or without even screen shot where did you stopped in fair simply process of using custom fields.
Quote from: Naturt on July 30, 2013, 14:21:07 PM
And if i made a template override, how i can e-mail the custom fields values to the customer?
At this point I'm even not sure that you already HAVE prepared for using custom fields. No link, remember?

As for template overrides...

Well, you could switch to standard Joomla template (beez5) and check how VM without any template overrides deal with your custom fields.

NOT EVERYBODY COULD FIGHT BLIND.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart