News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Problem with customfields after update 2.6.0a

Started by Simuel, May 11, 2014, 11:23:42 AM

Previous topic - Next topic

Simuel

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.


AH

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 .
Regards
A

Joomla 3.10.11
php 8.0

GJC Web Design

crossed prices is just css - without a live url can't help further
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Simuel

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.


GJC Web Design

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;
}
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Simuel

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?

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Simuel

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.

GJC Web Design

#9
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]
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Milbo

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

GJC Web Design

Will code something tomorrow - guess there is just a case missing - discount without tax
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

GJC Web Design

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]
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Simuel

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.


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?