News:

Looking for documentation? Take a look on our wiki

Main Menu

Unit Price Custom Field Liter / kg

Started by Lefteris, October 23, 2014, 09:06:39 AM

Previous topic - Next topic

Lefteris

Good Morning,

i Would like to know if there is possibility to have two values for the Unit price custom field. For example I have a site that sells Wines / delicatessen and i would like to show unter the price how much will the 1 liter or the 1 kilo costs. in case the product is 500ml or 200g. There is the possibility to use Language Override but you will have a default text for both Liter or KG. How can i set it, When i set in the Product Dimensions and Weight that the product Packaging for example is in Liter that it will show Price Pro Liter and when i have KG Price Pro Kg ? can i do that?


Joomla! 2.5.20 and vm2.0.26d.


Thanks in advance.


Lefteris

GJC Web Design

you would have to custom code it in your templates - they are after all just labels ...
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

Lefteris

any help with the code ? i'm a little bit newbie with all that :)

GJC Web Design

something like

if($this->product->product_weight){
  $unit = 'Kg';
}else{
$unit = 'Ltr';
}

echo $unit;
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

Lefteris


Lefteris

another question. where should i go to change the size of the product unit price text?

GJC Web Design

crystal ball gives me no reply - strange - normally works..

Just how would I know this?
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

Lefteris

i meant which file do i have to modify



the size of the  price pro liter / kg ( this is the Com_Virtuermart_Unitprice custom field ).

furthermore as i told you i am a newbie to that :) i may ask some stupid questions!

as consider the code for the kg / liter i wasnt able to do anything!


i have to edit the file in mytemplate/html/com_virtuemart/productdetails/default_showprices.php  yes?


echo $this->currency->createPriceDiv ('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $this->product->prices);
$unitPriceDescription = JText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE', JText::_('COM_VIRTUEMART_UNIT_SYMBOL_'.$this->product->product_unit));
echo $this->currency->createPriceDiv ('unitPrice', $unitPriceDescription, $this->product->prices);
echo '<span style="font-size: 12px;" > inkl. MwSt, zzgl.</span> <a style="font-size: 12px;" href="" <span>Versandkosten</span></a>';
}
?>
<>


this part of the code right? i would appreciate some help! :)


thanks in advance


jenkinhill

You should be able to use CSS to change the size of the price. Use Firebug to work it out.  http://forum.virtuemart.net/index.php?topic=116620.0
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

GJC Web Design

in that file yes - I assume $unitPriceDescription is the variable

But honestly  - when it comes to specific info for your site - we have given you the general advice etc
If you haven't got the skills to do this then, like anyone, you need to employ someone who does..

If your car breaks down and you don't know how to fix it u get a mechanic .. live's like that .. why should building a website be any different?
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

Lefteris

Quote from: jenkinhill on October 23, 2014, 16:09:53 PM
You should be able to use CSS to change the size of the price. Use Firebug to work it out.  http://forum.virtuemart.net/index.php?topic=116620.0

Thank you for your answer!



GJC yes you have right :) but if your employer tells you to make something, You will make it :) if you are able ok, if you are not. you will try to  :)