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

[SOLVED] Customize client custom fields

Started by alegrafic, October 07, 2017, 12:29:33 PM

Previous topic - Next topic

alegrafic

Hello,
how can I customize client custom fields?

in particular I want to insert two radio bottons that make me appear other fields

Insert screenshots of the fields to add


how can I do?

GJC Web Design

use a chk box but over ride the element display in the template over ride,   cart default_cartfields.php
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

alegrafic

hi,

can you have a small example or guide?

thank you

GJC Web Design

in the display loop detect "your" shopper field and render it differently

there is from memory already the T&C's field handled differently
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

alegrafic

hi,
its ok...

please,
a small example of override for VirtueMart of the default_cartfields.php file

Thanks You

GJC Web Design

<?php
      if ($field['hidden'] == true) {
         // We collect all hidden fields
         // and output them at the end
         $hiddenFields .= $field['formcode'] . "\n";
        } esleif ($field['name'] == 'yours') {
                  /* make your radios*/

      } else { ?>
            <?php echo $field['formcode'] ?>
         </div>
   <?php } ?>
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

alegrafic

hi,
thanks a lot for the suggestion,
this code is to be included in the default_cartfields.php file?


thanks you

GJC Web Design

have u even opened the file and had a look?

Be more proactive.. u can't expect free bespoke coding
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

alegrafic

Problem solved..

for hidden fileds in default_shopper o default_cart add this code in foreach {
if($singlefield['name']=='company'){
                echo "<div class='opg-width-1-1' style='display:none;' id='hide1'>";
            }elseif($singlefield['name']=='CF_PIVA'){
                echo "<div class='opg-width-1-1' style='display:none;' id='hide2'>";
            }else{
               
                echo "<div class='opg-width-1-1'>";
            }


the radiobutton also

if($singlefield['type'] == "radio")
            {
                echo "Register as a Business";
}


this is jQuery function for gestions switch SHOW/HIDDEN

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  <script type="text/javascript">
  $(document).ready(function(){
   // $(function(){
   $('input:radio[name="NAME OF RADIO BOTTON"]').change(function(){
        //$('#fatt_si_no1').on(function(){
       
        if($(this).val() == '1'){
            if( $('#hide1').css('display') == 'block' )
                $('#hide1').css('display','none');
            else
                $('#hide1').css('display','block');
           
         //return false;   
            if( $('#hide2').css('display') == 'block' )
                $('#hide2').css('display','none');
            else
                $('#hide2').css('display','block');

          //return false;
        }
        if($(this).val() == '0'){
            if( $('#hide1').css('display') == 'block' )
                $('#hide1').css('display','none');
            else
                $('#hide1').css('display','block');
       
         //return false;
           
            if( $('#hide2').css('display') == 'block' )
                $('#hide2').css('display','none');
            else
                $('#hide2').css('display','block');


         //return false;
       }
         
        });
    });
  </script>


that's all

bye