News:

Looking for documentation? Take a look on our wiki

Main Menu

Could be a problem with the custom fields order in the cart page

Started by amedesign, June 25, 2017, 17:28:27 PM

Previous topic - Next topic

amedesign

Hi everybody! Because is my first post I want to thanks you all are involved in this nice project of VirtueMart. I am reading almost all the posts (using RSS feed) so hope I will fit to all the rules from this forum.

First of all the necessary information:

Joomla 3.7.2
VirtueMart 3.2.3 (9579)
PHP 7.0.20
Protostar template with a lot of CSS styling by myself

Unfortunately the site is not yet online to show exactly the problem but I will try as possible to describe the problem I occurred. I have defined some custom fields (type S, Y and C) for the products and the things appears to work properly. have to admit that almost all of the Virtuemart modifications I made  is through phpMyAdmin, with 30 OpenOffice ods files. It is a big work for preparation but so easy to add later any modification. The problem I noticed is about the order of viewing of custom fields in the product detail page and then of course in the cart page, for different variants of the same products. To be more clear, for each product I have 5 custom fields (a custom field type C (multivariant), then one type Y, one type S, and then two type Y ) even some custom fields are disabled or override in different multivariant choices.

In the first time I saw that the position of different customs field in the product details page for a multivariant product changed depending of what type of multivariant I choose (some custom fields are not appears in different combination).  Of course in the first moment I checked the order of custom fields from josvp_virtuemart_product_customfields tabel and found some mistakes there and corrected them. In the product details page I have checked and no changing in the ordering of customs fields.

But in the cart page (controlled by default_pricelist.php) I see that the first two added to cart products the order of custom filed is ok, as expected by the order settings but for the third product the last to type Y custom fields are changed. So custom field no 4 is in the position no 5, and the number 5 custom field is in position number 4. This situation is not present in product details page (so seems that the order is ok, anyway I double checked in ods file and also in administration panel for that product, everything seems to be ok). More than that, I make different order of add to cart product, note down which one makes problems and select it first to cart. If it is added to cart that product which was the third added to cart before and shows problems, when is first in the cart, everything is ok with the custom fields ordering! So it appears that it is not a problem in josvp_virtuemart_product_customfields tabel, because of two reasons:

- in product detail page there is no problem;
- a product if has problem with the ordering, it has only if it is not added to cart in the first two products. The same product with problem (let's say it was in third position in the cart) if I added (after I delete the cart of course) in the first or second position in the cart, this problem disappear!

Inspected the cart page with browser (Firefox and Chrome) and see something which I don't know if it is ok or not, maybe it helps or could be just a big stupind observation. The cart page is based on a table, and there are added rows depending of how many products are in the cart. Similar, the class name of each <tr> is incremented with the "i" variable from the php file. So first class name of first <tr> is sectiontableentry1, the second is sectiontableentry2 but the third is again sectiontableentry1 instead of three, as I expected. I don't if this is really a problem but not this my problem. :) It doesn't matter for me if that name is incremented or not, I just told you this if there is any problem related to the described from the beginning.

I didn't check (should do this) what if I will have more that three products in the cart, if there will be any pattern for the reversing ordering of the last two same custom fields. For a complete investigation I should change the last customs fields to be different (now there are both the same Y type), to see if this will change anything in behavior. Also I mention that despite I override the default_pricelist template I check this with the native one (changed the name of the overrided file to use the native one) so I think that this overriding is not a problem. As I mentioned I use Protostar template, even it is very CSS stylized.

Thanks for you attention and sorry for this long post, I had to explain as well as I could.