VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: sbauscia on July 08, 2013, 20:06:46 PM

Title: Issue: every time i delete a product, some other lost their prices
Post by: sbauscia on July 08, 2013, 20:06:46 PM
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
Title: Re: Issue: every time i delete a product, some other lost their prices
Post by: PRO on July 08, 2013, 21:26:05 PM
sounds like you might have Database problems?

have you done work on the DB ?

Title: Re: Issue: every time i delete a product, some other lost their prices
Post by: franzpeter on July 09, 2013, 10:46:54 AM
@sbausicia,
Do you use an import tool for importing products?
Title: Re: Issue: every time i delete a product, some other lost their prices
Post by: Maxim Pishnyak on July 09, 2013, 11:36:15 AM
@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
Title: Re: Issue: every time i delete a product, some other lost their prices
Post by: sbauscia on July 09, 2013, 17:59:25 PM
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!
Title: Re: Issue: every time i delete a product, some other lost their prices
Post by: Maxim Pishnyak on July 09, 2013, 19:29:30 PM
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
Title: Re: Issue: every time i delete a product, some other lost their prices
Post by: PRO on July 09, 2013, 22:30:25 PM
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.

Title: Re: Issue: every time i delete a product, some other lost their prices
Post by: sbauscia on July 10, 2013, 10:48:22 AM
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
Title: Re: Issue: every time i delete a product, some other lost their prices
Post by: PRO on July 10, 2013, 23:32:26 PM
I am not getting this with mine.

It seems like there are database problems with IDs
Title: Re: Issue: every time i delete a product, some other lost their prices
Post by: urbisby on September 11, 2013, 08:21:59 AM
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!
Title: Re: Issue: every time i delete a product, some other lost their prices
Post by: Maxim Pishnyak on September 12, 2013, 20:11:24 PM
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).