Author Topic: custom field for selection  (Read 2965 times)

Naturt

  • Beginner
  • *
  • Posts: 30
custom field for selection
« on: July 26, 2013, 09:59:55 am »
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
Re: custom field for selection
« Reply #1 on: July 26, 2013, 16:25:03 pm »
What is the problem? You don't allow customers to buy more then four products at once?

Naturt

  • Beginner
  • *
  • Posts: 30
Re: custom field for selection
« Reply #2 on: July 26, 2013, 16:30:00 pm »
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
Re: custom field for selection
« Reply #3 on: July 26, 2013, 16:41:16 pm »
Four custom fields in one product (package).
Each custom field has the same variants: a,b,c,d.

Naturt

  • Beginner
  • *
  • Posts: 30
Re: custom field for selection
« Reply #4 on: July 26, 2013, 16:44:40 pm »
But what type of custom field? I want a product name and a quantity field

Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
Re: custom field for selection
« Reply #5 on: July 26, 2013, 16:48:56 pm »
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.

Naturt

  • Beginner
  • *
  • Posts: 30
Re: custom field for selection
« Reply #6 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)

Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
Re: custom field for selection
« Reply #7 on: July 26, 2013, 18:24:17 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?

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10377
  • VirtueMart Version: 3+
Re: custom field for selection
« Reply #8 on: July 27, 2013, 03:07:31 am »
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


J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

Naturt

  • Beginner
  • *
  • Posts: 30
Re: custom field for selection
« Reply #9 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?

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10377
  • VirtueMart Version: 3+
Re: custom field for selection
« Reply #10 on: July 30, 2013, 18:17:27 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?

J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

Naturt

  • Beginner
  • *
  • Posts: 30
Re: custom field for selection
« Reply #11 on: July 31, 2013, 09:02:49 am »
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

  • Beginner
  • *
  • Posts: 30
Re: custom field for selection
« Reply #12 on: July 31, 2013, 09:12:49 am »
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
Re: custom field for selection
« Reply #13 on: July 31, 2013, 11:02:14 am »
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.
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?
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.
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.