VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: m_online on January 29, 2015, 13:29:44 PM

Title: Delete prices not Working correctly
Post by: m_online on January 29, 2015, 13:29:44 PM
VM 2.6.12.2

has an product more than one Prices and we want to delete one of them will not work, when by chance " virtuemart_product_price_id " equal " virtuemart_product_id "  is.

in product.php

            foreach($old_price_ids as $key => $oldprice){
                     if(array_search($pricesToStore['virtuemart_product_price_id'], $oldprice )){
                     $pricesToStore = array_merge($oldprice,$pricesToStore);
                     $toUnset[] = $key;
            }



my fix works for me

            foreach($old_price_ids as $key => $oldprice){
                     if($pricesToStore['virtuemart_product_price_id'] == $oldprice['virtuemart_product_price_id'] ){
                     $pricesToStore = array_merge($oldprice,$pricesToStore);
                     $toUnset[] = $key;
            }



is this a Bug?