Hi.
When using customfields is there a way for the total price to show in the dropdown instead of the basepris + added price?
for example now
default 125
2 kg + 125
3 kg + 175
4 kg + 200
and so on.
I would like it to be
defalt 125
2 kg 250
3 kg 225
4 kg 325 or what ever prices used.
Regards, Lars
Anyone please :-)
I use this plugin
http://forum.virtuemart.net/index.php?topic=127362.0
and do "equal price"
Thx Pro, gould you give me an example?
Just need to see the light when you have many different products with many different prices.
the examples are given on the first post in the thread PRO pointed you to
Hi.
But when i use this:
5.Fix the price of a variant =
Config: Red,Green,Blue@=12.50
Gives prices of: Red Green = Retail, Blue = 12.50
The dropdown option turns white and dosent put in the = price.
show the configuration screen - not just the frontend
See image 2 posted
and this one
The dropdown option turns white and does not put in the = price.
When you use * the price is not shown
plugins/vmcustom/drop/tmpl/default.php
<?php
defined('_JEXEC') or die();
$product = $viewData[0];
$params = $viewData[1];
$options = explode(',', $params->custom_drop);
$class='';
$selects= array();
if (!class_exists('CurrencyDisplay')) require(VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php');
$currency = CurrencyDisplay::getInstance();
foreach ($options as $valuesWithPrice) {
$valueWithPrice = explode('@', $valuesWithPrice);
if ( isset ($valueWithPrice[1]) ) {
$op = $valueWithPrice[1][0];
$price = substr($valueWithPrice[1], 1) ;
$variant = substr($valueWithPrice[1], 0, 1) ;
if ($variant == "*") {
$text = $valueWithPrice[0] ;
} else {
$text = $valueWithPrice[0].' ('.$op.$currency->priceDisplay((float)$price).')';
}
} else {
$text = $valueWithPrice[0] ;
}
// $selects[] = array('value' =>$valueWithPrice[0], 'text' => $text );
$selects[] = array('value' =>$valueWithPrice[0], 'text' => htmlentities($text) );
}
$html = JHTML::_('select.genericlist', $selects,'customProductData['.$product->virtuemart_product_id.']['.$params->virtuemart_custom_id.']['.$params->virtuemart_customfield_id .'][custom_drop]','class=customdrop','value','text',$selects[0],false,true);
echo $html;
?>
you can try editing the template to see what happens if you remove this:-
if ($variant == "*") {
$text = $valueWithPrice[0] ;
} else {
When i remove that, the shop dosent load.
oh well - I guess this plugin is not any use for you
So i cant get an equal price for a variant is what you are telling me?
Lars
The "@=" option works for my installation
If you use a comma in an "=" price the variables will not work
And Multiply is not configured to show a price in the template
You should be able to change the default.php template in the plugin to get what you require
Unfortunately you will need to do this yourself.
This plugin was designed to meet my own specific needs and it does that, I offer this for free to help others out and as a starting point for those wishing to make their own customisations.
Here are some pointers to help you
The file to adjust is plugins/vmcustom/drop/tmpl/default.php
<?php
defined('_JEXEC') or die();
$product = $viewData[0];
$params = $viewData[1];
//Lars, this is where it splits up the variables for display using the comma
$options = explode(',', $params->custom_drop);
$class='';
$selects= array();
if (!class_exists('CurrencyDisplay')) require(VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php');
$currency = CurrencyDisplay::getInstance();
foreach ($options as $valuesWithPrice) {
$valueWithPrice = explode('@', $valuesWithPrice);
if ( isset ($valueWithPrice[1]) ) {
$op = $valueWithPrice[1][0];
$price = substr($valueWithPrice[1], 1) ;
$variant = substr($valueWithPrice[1], 0, 1) ;
//Lars, this is where it identifies a multiplier and does not show anything but the description e.g. 2kg, you would need to code to get a price from the multiplier here
if ($variant == "*") {
$text = $valueWithPrice[0] ; //display the price result here
} else {
$text = $valueWithPrice[0].' ('.$op.$currency->priceDisplay((float)$price).')';
}
} else {
$text = $valueWithPrice[0] ;
}
//Lars, this is also can cause a problem- Try changing which line is commented out
// $selects[] = array('value' =>$valueWithPrice[0], 'text' => $text );
$selects[] = array('value' =>$valueWithPrice[0], 'text' => htmlentities($text) );
}
$html = JHTML::_('select.genericlist', $selects,'customProductData['.$product->virtuemart_product_id.']['.$params->virtuemart_custom_id.']['.$params->virtuemart_customfield_id .'][custom_drop]','class=customdrop','value','text',$selects[0],false,true);
echo $html;
?>
:-)
Im sorry i dont know how to configure this. Perhaps an other shop system would suit me better? Even though i like this.