Bug with Custom field (string) being displayed on invoice

Started by nistune, June 16, 2020, 00:49:26 AM

Previous topic - Next topic

nistune

VirtueMart 3.8.2 10325 (was running 3.6.10)
Joomla 3.9.19

Hi

I have a custom field string setup with three items for some products, but disabled for others

Field entries: Individual Licence;Consult cable; Licence and cable (1st image)

They configured as a drop down list as you can see in (3rd image)

They are also hidden for my 'Type 2 TL' product which has them disabled (2nd image)

The bug is that the final invoice now shows all options (4th image)

Previously it did not prior to upgrading virtuemart, so the update has broken how these are displayed

Please find attached

Jörgen

Check Your override for the invoice creation in Your template.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

nistune

Could you please clarify what you mean?  I don't believe I have any overrides for the Virtuemart Invoice template...

I use the Joomla default template, and the CK Template Creator to override my general page default styles. I don't have a specific Cart / Invoice override style

This has always worked in VirtueMart until doing the recent update, and is also the invoice emails generated from VirtueMart are affected (which don't use the website display tempalte)

I just reconfirmed an older invoice in my system and the emails it spits out now shows the issue too. So its the invoice generation


nistune

Also my other two custom fields are showing in the order list entry, but not generated in the email.

So:
(D)isabled Field (Bundle) => Showing in email and order form (should not show in either, since customer did not select anything)
Enabled field (ECU ID) => Not showing in email, okay in order form
Enabled field (ECU part) => Not showing in email, okay in order form

This seems like the hidden email field flag used for generating emails has backwards logic

1. Image showing the item custom field configuration
2. Image showing the order page screen item, and what is seen by the customer / me in the confirmation email

Jörgen

Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

nistune

Tried that and it made things worse ... all the bundle options are displayed as separate items on the page (rather than a single drop list, comprised of each bundle item)


nistune


nistune


nistune

I should clarify that this was working fine (for the last 5 years, so I don't think this is a setup issue) until the recent VirtueMart updates. Let me know if there is anything else you need to debug this further

nistune

Another update... So there are two issues

1. Custom strings made as Admin List are all being listed in the backend order confirmation and emails to customer (not a problem in 3.6.10 but is in 3.8.2 / 3.84)

2. When order is initially placed, none of the custom fields (Generic child variant, or Plugins [text input], String) are being reported on the initial confirmed order (email). If I reconfirm the order then they are displayed in a second (updated) email. See first attachment

Both of the above only happen for products with custom field types disabled. See second attachment. Doesn't happen with my products without those fields disabled

I initially raised problem (2) with 3.6.2 when upgrading from 3.4.x
http://forum.virtuemart.net/index.php?topic=144356

Can I go backwards in Virtuemart versions to round down which one caused the bug? I only have a live site at the moment, so worst case have to make my own server and copy all this across for experimentation. Don't really have the time to debug this

patbe60

Hello

I have the same problem.

I have a parent product and two child products. The parent product can't be ordered. The first child product has two custom fields with two options, layout position addtocart. The second child is a download product and the derived customfields for this child product are disabled. In the shop on the website everything works fine. But in the email the download product shows all four options (two for the first and two for the second custom field).

These options of the customfields are shown in any email I'm using, confirmed by shopper and confirmed.

The problem startet with VM 3.8. I am on 3.8.4 now with J 3.9.19.

nistune

Yes that is the same configuration

Parent Product (not published)
  Child product 1 (all fields, including 'bundle' custom field drop down for adding different price addons)
  Child product 2 (disable 'bundle' field') => broken

Okay so the custom field drop down broke from at least V3.8 (fine in V3.6)

patbe60

The problem started with version 3.6.11. Before everything worked fine.

patbe60

In VM version 3.6.11 there is a change in:

administrator/components/virtuemart/models/product.php

The code in version 3.6.10 on line  1181 is:

$child->customfields = $customfieldsModel->getCustomEmbeddedProductCustomFields ($child->allIds,0,-1, true, $child->product_realparent_id);

In version 3.6.11 it is:

$child->customfields = $customfieldsModel->getCustomEmbeddedProductCustomFields ($child->allIds,0,-1, FALSE);

So when I change this code in version 3.8.4 on line 1185 with the code of version 3.6.10 everything works fine.


nistune

oh thats good you found it. That's one issue sorted

Just need to work out by some enabled fields aren't showing up in the first confirmation email for child products. Not such a massive issue, but annoying since I miss all the product details and have to go back into the backend to pull out the full order info