News:

Looking for documentation? Take a look on our wiki

Main Menu

Issue: every time i delete a product, some other lost their prices

Started by sbauscia, July 08, 2013, 20:06:46 PM

Previous topic - Next topic

sbauscia

Hi i have a big problem.
i have joomla 2.5.9. virtuemart 2.20b , php 5.3.26
every time i delete a product, some other product random lost its price.
i try to do all updates, clear cache, change ftp and mysql.
i don t know what i can do,
any suggestion?
thank you very much

PRO

sounds like you might have Database problems?

have you done work on the DB ?


franzpeter

@sbausicia,
Do you use an import tool for importing products?

Maxim Pishnyak

@sbausicia:
try to check your issue on other web hosting or maybe on the localhost

at any time you could rescue your web store with CSVI Improved:
1. export product information
2. recreate your web shop from scratch
3. import product information into new clone of your project
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

sbauscia

Hi, thanks to all for the quick reply.
i haven t made any import from other database, i add all products manually
i haven t made changes to database, ( except to 2.0.14 to 2.0.18 some months ago when i was developing this website, but before adding products, and now i try to update 2.0.20 there is the same error).
i will try to put all website on other hosting, i try to put it on other server on the same hosting, but the same problem.
i don t know what to do!

Maxim Pishnyak

use my advice
Quote from: Maxim Pishnyak on July 09, 2013, 11:36:15 AM
at any time you could rescue your web store with CSVI Improved:
1. export product information
2. recreate your web shop from scratch
3. import product information into new clone of your project
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

PRO

sbauscia,

are you sure this is happening?

I know I have found some random products with the "no price set"
Then, That just means it has 2 price sets, and I have to delete 1.


sbauscia

Hi Maxim, tomorrow i will try to do , i see the website now!
Pro, yes, everytime you delete a product..i have the copy of the website, can i send you through pm the user and password to try it? it is so strange and nobody has this problem
i try to put that prices that has no prices to 0euro, but i have still that problem

PRO

I am not getting this with mine.

It seems like there are database problems with IDs

urbisby

I had the same problem!
I think that the bug is into virtuemart!!!
First,
go to administrator\components\com_virtuemart\helpers\vmtable.php, near row 1365 and put
QuotevmError($query);
after this code:
Quoteforeach($list as $row){
            $ok = $row;
            $query = 'DELETE FROM `'.$table.'` WHERE '.$this->_tbl_key.' = "'.$row.'"';
            $this->_db->setQuery( $query );

Then try to delete one product.
You may see vmerror message like that:

DELETE FROM `#__virtuemart_products` WHERE virtuemart_product_id = "1385"
   .........
DELETE FROM `#__virtuemart_product_prices` WHERE virtuemart_product_price_id = "1385"

This means, that virtuemart is trying to delete the price with the id of product ( and it  is not real virtuemart_product_price_id).
So, if you have (or had) more than one price fo a single product, virtuemart_product_price_id != virtuemart_product_id
This means, that you will delete the price of some other product!!

Go to administrator\components\com_virtuemart\tables\product_prices.php AND set primary key
Quotevirtuemart_product_id
$this->setPrimaryKey('virtuemart_product_id');

It's not super, but it works!
Sorry for my English!

Maxim Pishnyak

Quote from: urbisby on September 11, 2013, 08:21:59 AM
DELETE FROM `#__virtuemart_product_prices` WHERE virtuemart_product_price_id = "1385"

This means, that virtuemart is trying to delete the price with the id of product ( and it  is not real virtuemart_product_price_id).
Calm down.

This means, that virtuemart is trying to delete the price with the id of that price (virtuemart_product_price_id) ( and it  is real virtuemart_product_price_id).
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart