This question has appeared on several threads but it has not been answered completely or directly.
Yes, in J17 you can do language overrides. But not in J15.
I finally got the Custom Selection Dropdown to work and show custom colors on a product.
But, I cannot get rid of the ": " that is appended to the colors:
purple : free
black : free
The word "free" is in the language file: en-GB.com_virtuemart.ini
Deleting it from that file deletes the word but not the colon character.
How to remove the colon ":" ?
Where is this occurring?
How can I remove it?
Many thanks!
You can exchange the language string by "0",0$ or "same cost" or what you want.
OK, but that was not my question.
How do you get rid of the colon ":" ?
I had a similar problem but I also wanted to add a '+' plus sign in front of the currency symbol if the custom option was not free.
Look in /administrator/components/com_virtuemart/models/customfields.php
Around line 559 I changed the code to look like this:
if ($group->field_type == 'V'){
$default = current($group->options);
foreach ($group->options as &$productCustom) {
if ((float)$productCustom->custom_price ) {
$price = $currency->priceDisplay($calculator->calculateCustomPriceWithTax($productCustom->custom_price)) ;
$price = "+".$price;
}
else $price = $free ;
$productCustom->text = $productCustom->custom_value." ".$price;
}
trevorsm, no need to hack the core, replace it
To add +
<?php $field->display = str_replace( '$', '+$', $field->display ); ?><?php echo $field->display ?>
To remove :
<?php $field->display = str_replace( ':', '', $field->display ); ?><?php echo $field->display ?>
Agreed, a much better solution. But as my currency symbol was £ in the generated code I ended up with this:
<span class="product-field-display"><?php echo str_replace(':', ' ', str_replace('£', "+£", $field->display)) ?></span><br>
Hi BanquetTables.pro,
Where can I view and change the coding for VirtueMart in VM2? I am using Joomla ver 1.7 hosted by CloudAccess.Net. From the template manager in Joolma, I can only view and edit Joolma template but I cannot find VirtueMart template. Please help, thanks in advance.
The template files are in /components/com_virtuemart/views - see http://forum.virtuemart.net/index.php?topic=90935.0 for help.
Quote from: BanquetTables.pro on December 26, 2011, 14:11:46 PM
trevorsm, no need to hack the core, replace it
To add +
<?php $field->display = str_replace( '$', '+$', $field->display ); ?><?php echo $field->display ?>
To remove :
<?php $field->display = str_replace( ':', '', $field->display ); ?><?php echo $field->display ?>
Hello,
in which file can i male this replace ? in a Override ?
Quote from: steinmuhly on February 12, 2012, 10:51:03 AM
Quote from: BanquetTables.pro on December 26, 2011, 14:11:46 PM
trevorsm, no need to hack the core, replace it
To add +
<?php $field->display = str_replace( '$', '+$', $field->display ); ?><?php echo $field->display ?>
To remove :
<?php $field->display = str_replace( ':', '', $field->display ); ?><?php echo $field->display ?>
Hello,
in which file can i male this replace ? in a Override ?
Well, you wanna change the product page right?
Look here
http://forum.virtuemart.net/index.php?topic=90935.0