VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: patrik60 on September 14, 2012, 11:28:29 AM

Title: Custom Field Type: String -> problem when price difference is 0
Post by: patrik60 on September 14, 2012, 11:28:29 AM
I'm using the custom field type "String".

Until now it was possible to leave the pricefield blank and no price was shown in the FE. In VM 2.0.11 even when I leave the field blank it is filled automatically with 0.00000. In the FE a price is shown: +0.00 €
This makes no sense. Is this your intention or is it a bug?
Title: Re: Custom Field Type: String -> problem when price difference is 0
Post by: Milbo on September 14, 2012, 11:47:09 AM
I would consider it as a bug.

I think we need a new parameter for createPriceDiv, if it should show a zero price or not.
Title: Re: Custom Field Type: String -> problem when price difference is 0
Post by: patrik60 on September 14, 2012, 19:48:09 PM
I have checked your changes in rev 6451. It is still not working. When installing this version I have seen also the changes in the DB:

Info: alterTable CHANGE jos_virtuemart_product_customfields.custom_price : ALTER TABLE `jos_virtuemart_product_customfields` CHANGE COLUMN `custom_price` `custom_price` DECIMAL(15,5) COMMENT 'PRICE'

Maybe this should be changed back into `custom_price` char(255) default NULL COMMENT 'price', ?? For me it worked this way.
Title: Re: Custom Field Type: String -> problem when price difference is 0
Post by: Milbo on September 16, 2012, 14:43:44 PM
no, a price is a number and should be stored as decimal and not as character.

If I enter via code 0 or 0.00 or 0.0000, I get always "No additional charge". The answer is imho not to use a cart variant.
Title: Re: Custom Field Type: String -> problem when price difference is 0
Post by: Milbo on September 16, 2012, 14:44:51 PM
Do you use it as list?
Title: Re: Custom Field Type: String -> problem when price difference is 0
Post by: patrik60 on September 16, 2012, 15:05:39 PM
QuoteDo you use it as list?

No

It worked fine for me until version 2.0.10.
Title: Re: Custom Field Type: String -> problem when price difference is 0
Post by: Milbo on September 16, 2012, 15:55:11 PM
Please provide me your exact configuration of the customfield
Title: Re: Custom Field Type: String -> problem when price difference is 0
Post by: patrik60 on September 16, 2012, 16:04:20 PM
See attached pics. On the product-example you see an empty price field. As soon as I save the product, the field is filled in with 0.0000 and on the FE the price +0.00€ is shown.



[attachment cleanup by admin]
Title: Re: Custom Field Type: String -> problem when price difference is 0
Post by: Milbo on September 17, 2012, 10:17:17 AM
just the screenshot is missing, showing the whole thing in the FE. I am sorry, I dont get it. Maybe a skype session would be easier
Title: Re: Custom Field Type: String -> problem when price difference is 0
Post by: patrik60 on September 17, 2012, 17:19:46 PM
QuoteIf I enter via code 0 or 0.00 or 0.0000, I get always "No additional charge".

OK. I have found now a solution: Since version 2.0.11 VM is using now the language variable COM_VIRTUEMART_CART_PRICE_FREE as soon as the price difference is 0. I can prevent now showing a price by making a language override and leaving the translation empty.

COM_VIRTUEMART_CART_PRICE_FREE=""

Originally the german translation is +0.00€
Title: Re: Custom Field Type: String -> problem when price difference is 0
Post by: Milbo on September 17, 2012, 23:34:47 PM
ahhhh, because I use always the english version
Title: Re: Custom Field Type: String -> problem when price difference is 0
Post by: martinelocke on October 04, 2012, 19:36:02 PM
You know, I have JUST today started having this same problem. Each time I try to remove the 0 in my custom field it gets replaced with 0.00000 when i save it and I can't work out how to stop it showing 'no additional charge' on the front end.

I would love to know what has changed with this update that I can change back? (I am using the english version)