News:

Support the VirtueMart project and become a member

Main Menu

Custom field do not display when product price is 0?

Started by randomdev, November 22, 2012, 03:43:54 AM

Previous topic - Next topic

randomdev

vm2.0.14

I am not sure if this is intentional or not, but when the products price is 0 none of the custom fields will display?
If this is intentional how would I modify this behaviour?

I also noticed the add to cart bar does not appear (which seems strange as there is a language description for free products?).

randomdev

#1
Well this one was easy to fix :

I removed the salesPrice check from the following on the productdetails default view:
if (!VmConfig::get('use_as_catalog', 0) and !empty($this->product->prices['salesPrice'])) {

Pushmanz

it's a fix, BUT....

I have the same problem using the custom field for PRICE BY LETTER . When i ad letters to the text box it calculates the price fine but the initial product price is added.
When the product price is 2 euro per letter it displays 2 euro and if i start typing letters in the text box it keeps adding 2 euros per letter. The first letter should not be calculated or I should be able to set te base price to 0 euro and still display the custom field.

I don't like to alter de code....i think the plugin needs work.

Any ideas on this?

PolishedGeek

The code that is being altered is core VM, not the plugin. Core VM doesn't (currently) allow you to display custom fields when the starting price is zero. The hack works around that, enabling various custom field plugins to work (like our Breezing Forms Custom Fields extension). 
~ Deb Cinkus, CEO
Polished Geek, LLC   |    www.PolishedGeek.com

Creators of JoomLister - eBay Lister for Joomla!

Grisu74

Hello I tried to delete salesPrice but nothing has changed, I would need at zero cost I can choose variants cart.
I enclose part of the code, if you can help me understand what needs to change for this solution, thanks

[attachment cleanup by admin]
Joomla 3.6.2
If you want to save money buy online at Veneziane & Plissé
www.venezianeplisse.com

randomdev

#5
You need to remove this (I can still see it in the image posted):
and !empty($this->product->prices['salesPrice'])

That will remove the check for an empty salesprice.


Before: if (!VmConfig::get('use_as_catalog', 0) and !empty($this->product->prices['salesPrice'])) {
After: if (!VmConfig::get('use_as_catalog', 0)) {

Grisu74

I modified the code as you wrote but I get the sale price, I will still be there, but it is zero, this is the result after editing code as I have shown you, help me please, thank you

[attachment cleanup by admin]
Joomla 3.6.2
If you want to save money buy online at Veneziane & Plissé
www.venezianeplisse.com

randomdev

I am not sure exactly what you want to do, but it sounds like you dont want to display the price if it is 0 but show the custom variants?

On my site I have a check above the product-price div to not display it if salesprice is 0.


if ($this->show_prices and !empty($this->product->prices['salesPrice'])) { ?>
<div class="product-price" id="productPrice<?php echo $this->product->virtuemart_product_id ?>">
etc etc



Milbo

Quote from: randomdev on November 22, 2012, 03:43:54 AM
vm2.0.14

I am not sure if this is intentional or not, but when the products price is 0 none of the custom fields will display?
If this is intentional how would I modify this behaviour?

I also noticed the add to cart bar does not appear (which seems strange as there is a language description for free products?).

That the add to cart is not there, that is imho correct, depends on your settings (Ask price or not). It is not intentional as I said in another post, the customfields were not written by me.

Next vm2.2 they will better, promised.
Quote from: Pushmanz on December 18, 2012, 08:06:36 AM
it's a fix, BUT....

I have the same problem using the custom field for PRICE BY LETTER . ...........
I don't like to alter de code....i think the plugin needs work.

Any ideas on this?

Yes, I alter the code completly official :-)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Grisu74

Hello, thanks for the reply, I want from price 0 and let the price is updated when choosing variants cart, you can?
Joomla 3.6.2
If you want to save money buy online at Veneziane & Plissé
www.venezianeplisse.com

Milbo

Please test with this, location \components\com_virtuemart\views\productdetails\tmpl

[attachment cleanup by admin]
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Grisu74

#11
Tried your code, you see the price

This happens to me when I set the product price 0

[attachment cleanup by admin]
Joomla 3.6.2
If you want to save money buy online at Veneziane & Plissé
www.venezianeplisse.com

Milbo

btw, IF you use the istraxx customsize plugin, then you can solve the problem different.

Example: Set as product price the net price for a 100 cm²,... set offset 100 and check "use offset as unit". This is also a typical support question for our ticket system http://extensions.virtuemart.net/ticket

But here the adjusted file

[attachment cleanup by admin]
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Grisu74

You use customsize istraxx. So I have to replace this file with the other two?
Joomla 3.6.2
If you want to save money buy online at Veneziane & Plissé
www.venezianeplisse.com

Milbo

the file has another name, to remove the title of the prices, we need to modify the third file.

I just explained, that it looks like you use the customsize istraxx plugin, which is written and sold by istraxx/me. I just wanted explain that you can use the offset and the "use offset as unit" to reach the same thing. Even better.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/