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

Custom Field - Remove "No Additional Charge" from custom field dropdown

Started by ntm91307, November 06, 2017, 19:43:00 PM

Previous topic - Next topic

ntm91307

I have a few custom fields that offer many options on drop down lists for the customer.  The addition of the price or the words "No Additional Charge" is something I'd rather not have them see in the drop down.  I'll handle that myself in the item details. 

My versions of Joomla! and VM aren't the most current but I've enjoyed a VERY stable site for almost two years and would rather not have to apply any upgrades to do this.  A flick of a checkbox or insert/delete/modify some CSS or PHP code somewhere are methods I'm comfortable with.

How can I safely and easily remove this verbiage?

Thank you...

Joomla! Version: 3.6.5
VM3: 3.0.18
PHP: 5.5.38
Thank you very much...
Michael

Jörgen

Hello

You can use the str_replace('No Additional Charge', '', $the_actual_item_str); and remove the text. Or You could find the text in the language file and remove it there.

I made something similar for VM 3.2.5 in sublayout/customfields.php approx line 53, replacing ( SEK 0,00) with nothing:


if (!empty($field->display)){ ?>
            <div class="product-field-display">
    <?php // JH 2017-10-14 
       echo str_replace('( SEK 0,00)'''$field->display);
            
?>

            </div>
        <?php 
          
}
        
?>



regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

misholini

Jörgen,
I am on J.3.8.3 and VM 3.2.8 but can not find this ccode in  either:
/components/com_virtuemart/sublayouts/customfields.php  or
templates/MY-TemPlate/html/com_virtuemart/sublayouts/customfields.php

I have managed to remove the wording "No additional charge" in the drop down selection of custom fields via language override.
Further I handled the addition of the price for custom fields in:
/administrator/components/com_virtuemart/models/customfields.php
by amending: $price ="+".$price; (around line 918)
to: $price ="";
This worked before updating Virtuemart from ver 3.2.4 to ver 3.2.8
After update the file had been overwritten so I re-applied the above change but nevertheless the custom fileds price addition continues to appear in the dropdown (e.g. customfieldName +€10).
Any suggestions how to achieve this again?