VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Lefteris on October 23, 2014, 09:06:39 AM

Title: Unit Price Custom Field Liter / kg
Post by: Lefteris on October 23, 2014, 09:06:39 AM
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
Title: Re: Unit Price Custom Field Liter / kg
Post by: GJC Web Design on October 23, 2014, 10:37:36 AM
you would have to custom code it in your templates - they are after all just labels ...
Title: Re: Unit Price Custom Field Liter / kg
Post by: Lefteris on October 23, 2014, 10:42:34 AM
any help with the code ? i'm a little bit newbie with all that :)
Title: Re: Unit Price Custom Field Liter / kg
Post by: GJC Web Design on October 23, 2014, 10:49:07 AM
something like

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

echo $unit;
Title: Re: Unit Price Custom Field Liter / kg
Post by: Lefteris on October 23, 2014, 11:02:51 AM
i will try it ! thank you very much!
Title: Re: Unit Price Custom Field Liter / kg
Post by: Lefteris on October 23, 2014, 12:03:13 PM
another question. where should i go to change the size of the product unit price text?
Title: Re: Unit Price Custom Field Liter / kg
Post by: GJC Web Design on October 23, 2014, 12:38:28 PM
crystal ball gives me no reply - strange - normally works..

Just how would I know this?
Title: Re: Unit Price Custom Field Liter / kg
Post by: Lefteris on October 23, 2014, 15:35:33 PM
i meant which file do i have to modify

(http://i.snag.gy/isKiS.jpg)

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

Title: Re: Unit Price Custom Field Liter / kg
Post by: 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
Title: Re: Unit Price Custom Field Liter / kg
Post by: GJC Web Design on October 23, 2014, 16:38:57 PM
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?
Title: Re: Unit Price Custom Field Liter / kg
Post by: Lefteris on October 24, 2014, 08:59:47 AM
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  :)