News:

Support the VirtueMart project and become a member

Main Menu

Can't delete prices

Started by PromoNet, October 05, 2013, 12:11:30 PM

Previous topic - Next topic

PromoNet

Ok so I clicked "Add new price" added a price in.  Then Saved it.

I realised that I didn't need the prices so I went in and pressed the red X to remove them.  Saved but they are still there.

I think this is a bug
Virtuemart for the Promotional Products Industry: http://www.promonet.co.uk/ (ProMart)

AH

Regards
A

Joomla 4.4.5
php 8.1

netr

I have the exact same problem. I am using VM 2.0.24c, Joomla 2.5.16.
The whole site was migrated from old Joomla 1.0 and VM 1.0 to the newer version (if this may have any impact on the problem).

jenkinhill

Working OK for me in VM2.0.26
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

netr

#4
I updated to VM 2.0.26 and price deletion still does not work.
I have php 5.4.21 on the server.

Can you give me some pointers on where to start debugging?

-edit-
I noticed, that I can delete all prices for some product and after that, I can add a new price.
However, I still can not remove only one price (if I have multiple prices).

EVC

Ditto can't remove prices once set. The red X never worked for me. VM V2.024

Agaton

Issue still exists on vm 2.0.26d and joomla 2.5.18 on apache/linux server

amymattian

Having the same problem on 2.0.26d and linux server.

Also when I have added special price for 4 pieces it does not show up in frontend! Anyone know what can be causing this?

Greetings,
Anne

worknmn

#8
I have same problem - can't delete added prices.
I am find feature in code of the product model.... There are build array for delete entry from database.

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

PHP function array_search scan all array $oldprice with same as value of $pricesToStore['virtuemart_product_price_id']
But it's wrong. Because we need check one field - virtuemart_product_price_id
I change that so:

            $toUnset = array();
            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;
              }
            }


File for edit \administrator\components\com_virtuemart\models\product.php
Search string "if($pricesToStore){"
my site: sagip.ru

Milbo

I just tested it. It works fine for me.
I added a price, stored it,... deleted the added price, removed.
I added a price, stored it,... deleted the FIRST price, is removed.

Do you have the problem maybe if you have more than 2 prices?
I added two prices at once, stored, both are there. I deleted the price in the middel, is removed,.. hmm. I cant see the problem.

Quote from: amymattian on February 12, 2014, 18:57:36 PM
Having the same problem on 2.0.26d and linux server.

Also when I have added special price for 4 pieces it does not show up in frontend! Anyone know what can be causing this?

Greetings,
Anne

This is correct. The multiprice feature works so that only one price is chosen and then used as the price. You can show the prices in vm2 with a bit layout hacking. But in vm3 it is native onboard and only a template/layout issue.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

worknmn

#10
Quote from: Milbo on March 12, 2014, 12:48:20 PM
I just tested it. It works fine for me.
I added a price, stored it,... deleted the added price, removed.
I added a price, stored it,... deleted the FIRST price, is removed.

In my way $pricesToStore['virtuemart_product_price_id'] value is equal with $oldprice['virtuemart_product_id'].
That's thy function array_search return true for record which should be delete.

Why you think is right to check value for all values of the array, if we need check only one $oldprice['virtuemart_product_price_id']?
my site: sagip.ru