VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: EsSa55 on December 05, 2020, 22:22:15 PM

Title: Product Price, image(s), Category(ies) and Manufacturer are now "empty"
Post by: EsSa55 on December 05, 2020, 22:22:15 PM
PHP-Version 7.3.24
Joomla version, 3.9.23.
VirtueMart 3.8.6 10373 -> 10378

Issue when updating to 3.8.6.10373 not solved with10378.

Database tables are correct.

In frontend and backend a few products display correctly but most do not seem to have a

Price, Image, Category or Manufacturer.

Installed to https://back3.4footyfans.com which is a recent backup of live site.

TIA

Title: Re: Product Price, image(s), Category(ies) and Manufacturer are now "empty"
Post by: AH on December 06, 2020, 10:38:13 AM
looks like you have a language issue?

Change the language and site falls over - or is that meant to happen with this test site
Title: Re: Product Price, image(s), Category(ies) and Manufacturer are now "empty"
Post by: EsSa55 on December 06, 2020, 15:03:48 PM
Quote from: AH on December 06, 2020, 10:38:13 AM
looks like you have a language issue?

Change the language and site falls over - or is that meant to happen with this test site

Yes, the languages are fixed to the Live site only....

The result of the issue can be seen in the frontend, but the backend for the products shows there is no price etc even though the tables have not changed since the update.

Title: Re: Product Price, image(s), Category(ies) and Manufacturer are now "empty"
Post by: EsSa55 on December 08, 2020, 14:29:39 PM
Following Milbo's advice, I disabled the 3 sql settings in VM config.

That solved the issue of No Image, Category, Manufacturer.

However, the products still have no price.

All product tables are in order and consistent.

Anyone able to offer a solution for the "no price" issue?

TIA
Title: Re: Product Price, image(s), Category(ies) and Manufacturer are now "empty"
Post by: EsSa55 on December 11, 2020, 14:50:35 PM
I have found the issue is the "has_prices" field in table __virtuemart_products

I have no idea what the field is for, nor the other 'has_' fields.

However, I did discover that 'has_prices' was set to 0 for all products without a price and set to null for all products with a price.

There did not seem to be any logic as to how or why most (6k+) products got 'has_prices' set to 0 or, by definition the few other were set to null.

UPDATE __virtuemart_products SET has_prices = null WHERE has_prices = 0;

solved the problem.

Perhaps someone will explain the purpose of the fields and how, by updating from 3.84 to 3.86/7 this issue arose?

TIA
Title: Re: Product Price, image(s), Category(ies) and Manufacturer are now "empty"
Post by: GJC Web Design on December 11, 2020, 15:34:55 PM
Hi Eddie,

it is to do with the table optimisations but these have been in VM since 3.8.0 I think .. certainly in 3.8.4

Some one will probably correct me but I think initially these are set by displaying all products in the product admin?
Title: Re: Product Price, image(s), Category(ies) and Manufacturer are now "empty"
Post by: EsSa55 on December 11, 2020, 15:47:08 PM
Thanks John

Yes, the fields are present also in 3.84 but I hadn't noticed them.

However, as I said above, disabling the 3 sql settings restored the "missing" images, categories and manufacturers, but not prices.

I am more concerned as to how/why updating from 3.84 to 3.86 caused most of the 'has_prices' field to be set to 0 and the remainder to null.

Once has_prices = 0, no prices display (at least in my installation).

The other concern is why my installation seems the only one to have the issue, in the first place.

TIA

Eddie
Title: Re: Product Price, image(s), Category(ies) and Manufacturer are now "empty"
Post by: Milbo on December 17, 2020, 09:23:56 AM
Okey then just update alll "has_prices" to Null. It should automatically update your products. I check now if the "resetter" is correctly resetting the "has_prices", because it worked for you for the other.

Btw, please activate the sql optimisations. As I wrote in the ticket, the optimisations worked for you already more than half a year.
Title: Re: Product Price, image(s), Category(ies) and Manufacturer are now "empty"
Post by: Milbo on December 17, 2020, 09:30:31 AM
Here is an explanation of the sql optimisation feature
https://docs.virtuemart.net/tutorials/development/241-reduced-database-access-by-using-booleans-for-reference-tables.html
Title: Re: Product Price, image(s), Category(ies) and Manufacturer are now "empty"
Post by: EsSa55 on December 17, 2020, 11:26:38 AM
Quote from: Milbo on December 17, 2020, 09:23:56 AM
Okey then just update alll "has_prices" to Null. It should automatically update your products. I check now if the "resetter" is correctly resetting the "has_prices", because it worked for you for the other.

Btw, please activate the sql optimisations. As I wrote in the ticket, the optimisations worked for you already more than half a year.

Thanks, but you already advised me to disable the sql settings and the missing categories, images, manufacturers re-appeared.

Maybe the setting did work for more than half a year, but they did not once I updated to 3.86.

TIA
Title: Re: Product Price, image(s), Category(ies) and Manufacturer are now "empty"
Post by: EsSa55 on December 17, 2020, 11:28:59 AM
Quote from: Milbo on December 17, 2020, 09:30:31 AM
Here is an explanation of the sql optimisation feature
https://docs.virtuemart.net/tutorials/development/241-reduced-database-access-by-using-booleans-for-reference-tables.html

Thank You
Title: Re: Product Price, image(s), Category(ies) and Manufacturer are now "empty"
Post by: EsSa55 on December 17, 2020, 11:32:43 AM
Milbo

As you advise, I re-enabled the sql settings and categories, images and manufacturers disappeared again.....

TIA
Title: Re: Product Price, image(s), Category(ies) and Manufacturer are now "empty"
Post by: EsSa55 on December 17, 2020, 12:27:31 PM
Optimise sql requests for products   
Optimise sql requests for calculation rules   
Optimise sql requests for categories

I have narrowed the issue to when products AND categories are both enabled.

If either is disabled, there is no issue.