Author Topic: Custom field do not display when product price is 0?  (Read 4243 times)

randomdev

  • Jr. Member
  • **
  • Posts: 90
Custom field do not display when product price is 0?
« 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?).

randomdev

  • Jr. Member
  • **
  • Posts: 90
Re: Custom field do not display when product price is 0?
« Reply #1 on: November 22, 2012, 07:02:55 am »
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

  • Beginner
  • *
  • Posts: 8
Re: Custom field do not display when product price is 0?
« Reply #2 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 . 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

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 263
  • Joomla! Innovation Refined.
    • Polished Geek, LLC - Joomla! extensions, web development & custom integrations
Re: Custom field do not display when product price is 0?
« Reply #3 on: December 18, 2012, 15:11:15 pm »
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

  • Jr. Member
  • **
  • Posts: 190
    • Veneziane & Plissé
  • VirtueMart Version: VM 3.0.18
Re: Custom field do not display when product price is 0?
« Reply #4 on: December 18, 2012, 22:11:36 pm »
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

  • Jr. Member
  • **
  • Posts: 90
Re: Custom field do not display when product price is 0?
« Reply #5 on: December 19, 2012, 03:20:07 am »
You need to remove this (I can still see it in the image posted):
Code: [Select]
and !empty($this->product->prices['salesPrice'])
That will remove the check for an empty salesprice.

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

Grisu74

  • Jr. Member
  • **
  • Posts: 190
    • Veneziane & Plissé
  • VirtueMart Version: VM 3.0.18
Re: Custom field do not display when product price is 0?
« Reply #6 on: December 19, 2012, 21:55:26 pm »
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

  • Jr. Member
  • **
  • Posts: 90
Re: Custom field do not display when product price is 0?
« Reply #7 on: December 20, 2012, 02:24:44 am »
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.

Code: [Select]
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9853
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Custom field do not display when product price is 0?
« Reply #8 on: December 20, 2012, 13:05:38 pm »
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.
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 :-)
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Grisu74

  • Jr. Member
  • **
  • Posts: 190
    • Veneziane & Plissé
  • VirtueMart Version: VM 3.0.18
Re: Custom field do not display when product price is 0?
« Reply #9 on: December 20, 2012, 13:06:33 pm »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9853
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Custom field do not display when product price is 0?
« Reply #10 on: December 20, 2012, 13:22:47 pm »
Please test with this, location \components\com_virtuemart\views\productdetails\tmpl

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

Grisu74

  • Jr. Member
  • **
  • Posts: 190
    • Veneziane & Plissé
  • VirtueMart Version: VM 3.0.18
Re: Custom field do not display when product price is 0?
« Reply #11 on: December 20, 2012, 13:38:50 pm »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9853
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Custom field do not display when product price is 0?
« Reply #12 on: December 20, 2012, 13:49:19 pm »
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]
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Grisu74

  • Jr. Member
  • **
  • Posts: 190
    • Veneziane & Plissé
  • VirtueMart Version: VM 3.0.18
Re: Custom field do not display when product price is 0?
« Reply #13 on: December 20, 2012, 13:57:17 pm »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9853
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Custom field do not display when product price is 0?
« Reply #14 on: December 20, 2012, 14:06:25 pm »
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.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/