VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: hazael on September 14, 2022, 12:35:11 PM

Title: Custom field values ​​are not displayed - [VM4.0.X]
Post by: hazael on September 14, 2022, 12:35:11 PM
In random cases, the custom field values ​​are not displayed in the product list.
I noticed a clear dependency with the VM template configuration for the product list.
For example
If I enable the "Show featured" option in the product list configuration, then 1 random parent product on the list of other products will not display the custom fields.
If I enable next option: the "Show latest products", then 2 random parent products on the list of other products will not display the custom fields.

For this error to occur, the parent product must have the "disinh" option checked in the selected custom field, which prevents the derivative product from inheriting this value.

The problem has been present since changes were made to the display of custom fields for derived products.

The problem is not related to custom site templates.
Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: Milbo on October 04, 2022, 21:38:20 PM
Crazy thing, but I cannot reproduce it, maybe fixed.
Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: hazael on October 06, 2022, 21:00:17 PM
I tried to install VM 4.0.7.x

Unfortunately, this version does not work with Joomla 3.10. I wrote about it before. Each attempt to edit the product causes loops and freezes of the system.



In general, in the last version 4.0.7.10717, you probably changed something, because now none of the values ​​from the custom fields is displayed on the product list :)
But the funniest thing is that the same template I made displays correctly in the component's search results: com_customfilters
I don't understand what's wrong with my code?

com_virtuemart/sublayouts/bs3-products.php
Quote<ul>
                                                <li class="bedroom">
                            <i class="fa fa-hotel"></i>
<?php if (isset($product->customfieldsSorted['pokoje'])){foreach ((array) $product->customfieldsSorted['pokoje'] as $field) {echo $field->display;}} ?>
                            </li>
                                                <li class="bathroom">
                            <i class="fa fa-s15"></i>
<?php if (isset($product->customfieldsSorted['lazienki'])){foreach ((array) $product->customfieldsSorted['lazienki'] as $field) {echo $field->display;}} ?>
                     </li>
                                                <li class="garage">
                            <i class="fa fa-car"></i>
<?php if (isset($product->customfieldsSorted['garaz'])){foreach ((array) $product->customfieldsSorted['garaz'] as $field) {echo str_replace('brak','0', $field->display);} } ?></li>
                                                <li class="area-size">
                            <span class="img-wrap">
                                <img src="/templates/szeregowe/images/sqft.svg" alt="Powierzchnia użytkowa" title="Powierzchnia użytkowa" width="18px" height="19px">
                            </span>
<?php if (isset($product->customfieldsSorted['uzytkowa'])){foreach ((array) $product->customfieldsSorted['uzytkowa'] as $field) {echo $field->display;}} ?> m<sup>2</sup></li>
                    </ul>
Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: GJC Web Design on October 06, 2022, 22:05:21 PM
https://dev.virtuemart.net/attachments/download/1334/com_virtuemart.4.0.7.10717.zip custom field loop is fixed I think
Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: hazael on October 07, 2022, 10:50:53 AM
Quote from: GJC Web Design on October 06, 2022, 22:05:21 PM
4.0.7.10717 custom field loop is fixed I think
It is not the custom fields that cause the loops. The loop is created after starting the product edition in the administration panel in Joomla 3 and VM 4.0.7.x. During this time, you may notice a freeze of website. (Joomla 3 and VM4.0.6 it's ok)
Unfortunately - this last version also has this problem. I note - it only appears with Joomla 3.10.x. Joomla 4 has no problem with that.
-------------------------------------------

The non-appearance of custom fields in the product list is an additional weird effect - as the primary thread in this topic
I don't understand why custom fields don't appear in the product list - what's wrong?

Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: Milbo on October 08, 2022, 23:07:56 PM
Yes, I changed it back, so that it loads only cartattributes, before it loaded all, but only showed cart attributes. Should make no difference. Editing products works for me in j3 with new and old template. There was never a problem. Do you have this with a new product?
Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: hazael on October 11, 2022, 14:48:34 PM
I don't just want cart attributes. Without this additional data in the product list Virtuemart won't make any sense to me.


I don't know what you've done, but from version com_virtuemart.4.0.7.10714  in the product list no longer shows me any custom field data.
But I found a solution to it.
Additional fields (not for the basket) in the list of products are now displayed to me if I enable the search option for them. Some products, unfortunately, still don't display them



---------------------------------------
PS. the loop I wrote about above is related to your correction for custom fields related to the text editor in the file customfields.php - it is incompatible with other editors
https://forum.virtuemart.net/index.php?topic=147269.msg531701#msg531701

Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: hazael on October 12, 2022, 13:40:31 PM
Will these checkboxes visible in the basic version of the template be finally removed from parents products? I can see that this is no longer present in the new template.
I admit that the idea of ​​introducing them for parents' products is definitely better than the old solution, which works the other way around - in child-products.
Unfortunately, it was this new solution that impossible custom fields from appearing in some products on the list. I went back to the old cumbersome solution that takes a lot more time to edit products in this store. :-/

Operating an online store should be convenient not only for the buyer, but also for the seller ...

You can always add the option of mass checking checkboxes or clearing all custom fields in child products. I did it once, and it's an effective way to reduce my working time
https://forum.virtuemart.net/index.php?topic=147849.msg527457#msg527457
Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: Milbo on October 12, 2022, 22:01:31 PM
Quote from: hazael on October 12, 2022, 13:40:31 PM
Will these checkboxes visible in the basic version of the template be finally removed from parents products? I can see that this is no longer present in the new template.
I admit that the idea of ​​introducing them for parents' products is definitely better than the old solution, which works the other way around - in child-products.
Imho it works both ways.

Quote from: hazael on October 12, 2022, 13:40:31 PM
Unfortunately, it was this new solution that impossible custom fields from appearing in some products on the list. I went back to the old cumbersome solution that takes a lot more time to edit products in this store. :-/
I understand what you wrote, but I dont get it. The checkbox "disinh" means "Inheritable". I need to rename it. So if the attribute should be only for the parent, you can disable it here for all children. So you say, if you use this setting for customfields with cart attribute set, then you do not see this customfield for the parent anylonger?

Quote from: hazael on October 12, 2022, 13:40:31 PM
Operating an online store should be convenient not only for the buyer, but also for the seller ...

You can always add the option of mass checking checkboxes or clearing all custom fields in child products. I did it once, and it's an effective way to reduce my working time
https://forum.virtuemart.net/index.php?topic=147849.msg527457#msg527457
Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: hazael on October 12, 2022, 23:18:40 PM
Quote from: Milbo on October 12, 2022, 22:01:31 PM
(...) So if the attribute should be only for the parent, you can disable it here for all children. So you say, if you use this setting for customfields with cart attribute set, then you do not see this customfield for the parent anylonger?
If the custom field is not assigned to the cart, it is not displayed in the product list. If I select the search option in the custom field settings, the custom fields will be shown in product list. Previously, this worked without these dependencies.
Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: Milbo on October 12, 2022, 23:33:57 PM
The question is, if it does depend on the  "Inheritable" setting.
Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: hazael on October 13, 2022, 10:58:17 AM
1. In the new version (from 4.0.7.10714), all custom fields disappear from the list of products - regardless of whether they are children's products or parents' products. The problem disappears if I select "search" in the custom field options.
------------------------------------
2. In the base VM template - in the parent product, if in the added custom fields I check the option of blocking inheritance of this in children's products, some the parents products in the product list are not displaying custom field data
------------------------------------
3. If in the child product I block or overwrite the inheritance of custom fields from the parent product, the above problem does not exist as in point 2

Quote from: Milbo on October 12, 2022, 22:01:31 PM
I understand what you wrote, but I dont get it. The checkbox "disinh" means "Inheritable".
In VM, the term "disinh" has probably always existed -  I thought it was "something" is written in German  ;)

PS. Forgive me for my linguistic incorrectness - I'm trying my best  :D
Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: Studio 42 on October 13, 2022, 15:06:36 PM
A customer reported me that in the cart adding 2 time same product with different cart attributes  setting do not show anymore the fiels for the second product in the cart.
If he remove the first product, the attributes are show for the remaining product in the cart.
The problem appear  only with Virtuemart 4, so  certainly a problem with this code too.
Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: Milbo on October 14, 2022, 15:55:49 PM
Please search in view.html.php of the category view for $this->productModel->cartattribute = 1; (around line 105), what happens, when you set it to 0? $this->productModel->cartattribute = 0;
Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: hazael on October 14, 2022, 20:04:07 PM
After this change, custom field data is displayed in the product list without having to be assigned to a search engine.
So the problem I wrote about in point 1 is solved...

...But it doesn't solve the problem I wrote about in the first post.

I do not understand this. Why is the custom field data from the parents' products inherited at the same time, when the child's product has its own independent data? What is it for?
There are other fields such as product name, short and long description, price - In this case I do not see double data - it is automatically replaced by the child product. Why can't it be the same with custom fields?


Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: hazael on October 15, 2022, 12:58:19 PM
By the way... I think I found another bug! Yupi!!!  8)

if the child's product has no prices, the price from the parent's product is not inherited. Child product everywhere displays "no price" or "ask about price"
Title: Re: Custom field values ​​are not displayed - [VM4.0.X]
Post by: Darko F. on October 16, 2022, 22:12:56 PM
I test with J4 and VirtueMart 4.0.7 10720

I can confirm child product don't inherent Categories and Prices