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
?
Maybe you should first try to understand, why the standard popup is not working for you
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........
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.