News:

Support the VirtueMart project and become a member

Main Menu

Legal info Popup under TOS popup in checkout??

Started by Otto0815, June 21, 2012, 22:51:07 PM

Previous topic - Next topic

Otto0815

Hi,

i would like to have an Pop-up with the legal info (german "widerrufsbelehrung") in the checkout under the TOS Pop-Up..but i cant get it to work...

I simply copied the follwing code:

         <?php // Terms Of Service Checkbox
         if (!class_exists('VirtueMartModelUserfields')){
            require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'userfields.php');
         }
         $userFieldsModel = VmModel::getModel('userfields');
         if($userFieldsModel->getIfRequired('agreed')){
             ?>
             <label for ="tosAccepted">
             <?php
            if(!class_exists('VmHtml'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'html.php');
            echo VmHtml::checkbox('tosAccepted',$this->cart->tosAccepted,1,0,'class="terms-of-service"');

      if(VmConfig::get('oncheckout_show_legal_info',1)){
      ?>
      <div class="terms-of-service">
         <span class="terms-of-service" rel="facebox"><span class="vmicon vm2-termsofservice-icon"></span><?php echo JText::_('COM_VIRTUEMART_CART_TOS_READ_AND_ACCEPTED'); ?><span class="vm2-modallink"></span></span>
         <div id="full-tos">
            <h2><?php echo JText::_('COM_VIRTUEMART_CART_TOS'); ?></h2>
            <?php echo $this->cart->vendor->vendor_terms_of_service;?>

         </div>
      </div>
      <?php
      } // VmConfig::get('oncheckout_show_legal_info',1)
            //echo '<span class="tos">'. JText::_('COM_VIRTUEMART_CART_TOS_READ_AND_ACCEPTED').'</span>';
            ?>
             </label>
          <?php
         }

and changed the Line:

<?php echo $this->cart->vendor->vendor_terms_of_service;?>

to

<?php echo $this->cart->vendor_legal_info;?>

I i do the last change (<?php echo $this->cart->vendor_legal_info;?>) to the original code, the pop up link shows the legal info; but if i copy everything only the TOS are shown...

Can someone help me out?

Thx
 

Milbo

?

Maybe you should first try to understand, why the standard popup is not working for you
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Otto0815

Ok, igot it......first you have to declare the facebox, like this:

<?php
JHtml::_('behavior.formvalidation');
$document = &JFactory::getDocument();
$document->addScriptDeclaration("
   jQuery(document).ready(function($) {
      $('div#full-legal').hide();
      $('span.legal').click( function(){
         //$.facebox({ span: '#full-tos' });
         $.facebox( { div: '#full-legal' }, 'my-groovy-style');
      });
   });
");
$document->addStyleDeclaration('#facebox .content {display: block !important; height: 480px !important; overflow: auto; width: 600px !important; }');
?>

and then you can call the vendor legal info with this:

   <?php // Widerrufsbelehrung          ?>
      <div class="terms-of-service">
         <span class="legal" rel="facebox"><span class="vmicon vm2-termsofservice-icon"></span><?php echo JText::_('Hier finden Sie Informationen zu Ihrem Widerrufsrecht'); ?><span class="vm2-modallink"></span></span>
         <div id="full-legal">
            <?php echo $this->cart->vendor->vendor_legal_info;?>

         </div>
      </div>

I think it's not the cleanest kind of code, but it works........

Zer0g

Good work, i've been searching for this...

However, i had to change this <?php echo $this->cart->vendor->vendor_legal_info;?>
into <?php echo $cart->cart->vendor->vendor_legal_info;?>
Now this works perfect for me.