VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Simuel on May 11, 2014, 11:23:42 AM

Title: Problem with customfields after update 2.6.0a
Post by: Simuel on May 11, 2014, 11:23:42 AM
Hello people,
i have 2 problems with site after update 2.6.0a.

1st - i use this solution to seeing custom field in category page: http://forum.virtuemart.net/index.php?topic=90961.msg398209#msg398209 and it works for me. But after update only some items have customfields (i have custom fields in every item).

2nd - problem with base price - in every item i have crossed price, and crossed price is the same as base Price With Tax see image

Can you help me fix this? Thank you and sorry for my english.

(http://www.equielite.sk/images/sampledata/ukaz.JPG)
Title: Re: Problem with customfields after update 2.6.0a
Post by: AH on May 11, 2014, 12:15:35 PM
Did you re-do your override for the category page

It may be that something has changed in the ad to cart code that is not catered for in  your category add to cart override?

Sometimes overrides need to cater for base coding changes .
Title: Re: Problem with customfields after update 2.6.0a
Post by: GJC Web Design on May 11, 2014, 12:21:56 PM
crossed prices is just css - without a live url can't help further
Title: Re: Problem with customfields after update 2.6.0a
Post by: Simuel on May 11, 2014, 16:37:52 PM
Quote from: Hutson on May 11, 2014, 12:15:35 PM
Did you re-do your override for the category page

It may be that something has changed in the ad to cart code that is not catered for in  your category add to cart override?

Sometimes overrides need to cater for base coding changes .

I mean not, after update i use the new default_addtocart - and the custom field is correct for some items.
Title: Re: Problem with customfields after update 2.6.0a
Post by: Simuel on May 11, 2014, 16:39:40 PM
Quote from: GJC Web Design on May 11, 2014, 12:21:56 PM
crossed prices is just css - without a live url can't help further
Live site is www.equielite.sk and items are in:

http://www.equielite.sk/pre-jazdca
http://www.equielite.sk/pre-jazdca/jazdecke-oblecenie
Title: Re: Problem with customfields after update 2.6.0a
Post by: GJC Web Design on May 11, 2014, 17:28:45 PM
crossed prices - I really don't know what your asking

your displaying the  PricebasePriceWithTax

and your css clearly states

#povodna-cena-s-dph .PricebasePriceWithTax {
  color: #FF6666;
  font-size: 11px;
  margin: 0 8px;
 text-decoration: line-through;
}
Title: Re: Problem with customfields after update 2.6.0a
Post by: Simuel on May 11, 2014, 17:39:57 PM
Quote from: GJC Web Design on May 11, 2014, 17:28:45 PM
crossed prices - I really don't know what your asking

your displaying the  PricebasePriceWithTax

and your css clearly states

#povodna-cena-s-dph .PricebasePriceWithTax {
  color: #FF6666;
  font-size: 11px;
  margin: 0 8px;
 text-decoration: line-through;
}

I mean that i have one crossed base price and one base price with tax - but i havent set sale. I set only product price, a this two prices is showing. You know?
Title: Re: Problem with customfields after update 2.6.0a
Post by: GJC Web Design on May 11, 2014, 18:00:56 PM
switch off the base price with tax display in the VM price display admin

if that doesn't work then it is your template - if it's 3rd party you have to ask the developer
Title: Re: Problem with customfields after update 2.6.0a
Post by: Simuel on May 11, 2014, 18:08:43 PM
Quote from: GJC Web Design on May 11, 2014, 18:00:56 PM
switch off the base price with tax display in the VM price display admin

if that doesn't work then it is your template - if it's 3rd party you have to ask the developer
If i do that (switch off) then it is OK. But sometime I wont show "old price","new price" and discount. And if I switch off this base price I can't show old price.
Title: Re: Problem with customfields after update 2.6.0a
Post by: GJC Web Design on May 11, 2014, 18:46:44 PM
Hmmm - this doesn't appear to be working (clean 2.6.0a)
the code in components/com_virtuemart/views/productdetails/tmpl/default_showprices.php

there is code there to show 'basePriceWithTax' crossed out if the sale price is not equal to it


if (round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices) . "</span>";
}


but the price array node 'basePriceWithTax'  is empty if there is no tax applied so the original price never shows

    [costPrice] => 24.98000
    [basePrice] => 24.98
    [basePriceVariant] => 24.98
    [basePriceWithTax] => 0
    [discountedPriceWithoutTax] => 22.98
    [priceBeforeTax] => 24.98
    [salesPrice] => 22.98
    [taxAmount] => 0
    [salesPriceWithDiscount] => 22.98
    [salesPriceTemp] => 22.98
    [unitPrice] => 0
    [discountAmount] => -2
    [priceWithoutTax] => 24.98

for the price setting in the screen shot

but basePriceWithTax is empty

if I add a tax then basePriceWithTax is there so the logic works and the pre-discount price shows

without any tax if I change the code to

if (round($this->product->prices['priceBeforeTax'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('priceBeforeTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices) . "</span>";
}


If no discount then only the end price shows

but this will depend on your particular pricing - you need to experiment


have to admit the logic of the code in components/com_virtuemart/views/productdetails/tmpl/default_showprices.php  seems sorely lacking in logic

[attachment cleanup by admin]
Title: Re: Problem with customfields after update 2.6.0a
Post by: Milbo on May 11, 2014, 21:36:55 PM
Do you have a fix for us? :-)
Title: Re: Problem with customfields after update 2.6.0a
Post by: GJC Web Design on May 11, 2014, 22:11:45 PM
Will code something tomorrow - guess there is just a case missing - discount without tax
Title: Code to fix non display of "crossed out" price when no tax is applied to the pro
Post by: GJC Web Design on May 12, 2014, 11:47:25 AM
Code to fix non display of "crossed out" price when no tax is applied to the product  vm2.6.0a

components/com_virtuemart/views/productdetails/tmpl/default_showprices.php
~ line 42

replace
if (round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices) . "</span>";
}


with

//discount display start
if($this->product->prices['taxAmount'] > 0 ){
if (round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices) . "</span>";
}
}else{
if (round($this->product->prices['basePrice'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices) . "</span>";
}
}
//discount display end


price display settings in screen shot

checked with no discounts and/or no tax - just retail price displays


[attachment cleanup by admin]
Title: Code to fix non display of "crossed out" price when no tax is applied to the pro
Post by: GJC Web Design on May 12, 2014, 11:51:10 AM
continued screens

[attachment cleanup by admin]
Title: Re: Problem with customfields after update 2.6.0a
Post by: Simuel on May 13, 2014, 11:51:42 AM
Quote from: Simuel on May 11, 2014, 11:23:42 AM
Hello people,
i have 2 problems with site after update 2.6.0a.

1st - i use this solution to seeing custom field in category page: http://forum.virtuemart.net/index.php?topic=90961.msg398209#msg398209 and it works for me. But after update only some items have customfields (i have custom fields in every item).

2nd - problem with base price - in every item i have crossed price, and crossed price is the same as base Price With Tax see image

Can you help me fix this? Thank you and sorry for my english.

(http://www.equielite.sk/images/sampledata/ukaz.JPG)
In 1st question - now I see that if is item 2 days old the custom field is not show, but if is item new the custom field is show. Where can i fix it?