Author Topic: Issue: every time i delete a product, some other lost their prices  (Read 2622 times)

sbauscia

  • Beginner
  • *
  • Posts: 7
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

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10362
  • VirtueMart Version: 3+
Re: Issue: every time i delete a product, some other lost their prices
« Reply #1 on: July 08, 2013, 21:26:05 pm »
sounds like you might have Database problems?

have you done work on the DB ?

J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: Issue: every time i delete a product, some other lost their prices
« Reply #2 on: July 09, 2013, 10:46:54 am »
@sbausicia,
Do you use an import tool for importing products?

Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
Re: Issue: every time i delete a product, some other lost their prices
« Reply #3 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

sbauscia

  • Beginner
  • *
  • Posts: 7
Re: Issue: every time i delete a product, some other lost their prices
« Reply #4 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!

Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
Re: Issue: every time i delete a product, some other lost their prices
« Reply #5 on: July 09, 2013, 19:29:30 pm »
use my advice
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

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10362
  • VirtueMart Version: 3+
Re: Issue: every time i delete a product, some other lost their prices
« Reply #6 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.

J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

sbauscia

  • Beginner
  • *
  • Posts: 7
Re: Issue: every time i delete a product, some other lost their prices
« Reply #7 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

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10362
  • VirtueMart Version: 3+
Re: Issue: every time i delete a product, some other lost their prices
« Reply #8 on: July 10, 2013, 23:32:26 pm »
I am not getting this with mine.

It seems like there are database problems with IDs
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

urbisby

  • Beginner
  • *
  • Posts: 1
Re: Issue: every time i delete a product, some other lost their prices
« Reply #9 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
Quote
vmError($query);
after this code:
Quote
         foreach($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
Quote
virtuemart_product_id
$this->setPrimaryKey('virtuemart_product_id');

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

Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
Re: Issue: every time i delete a product, some other lost their prices
« Reply #10 on: September 12, 2013, 20:11:24 pm »
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).