Page 1 of 1

Extra link in the cart

PostPosted: Wed May 06, 2015 1:37 am
by estiloss
Is it possible to add an additional link in the cart?

Thank you.

Re: Extra link in the cart

PostPosted: Wed May 06, 2015 3:15 pm
by admin
hello, the simplest way to modify or add a new link here is to change your OPC template at:

\components\com_onepage\themes\band_box\onepage.unlogged.tpl.php
\components\com_onepage\themes\band_box\onepage.logged.tpl.php

or see if you are using other variant of band_box theme.


the original code looks like this:
Code: Select all
if ($tos_required)
{

?>
   <div id="agreed_div" class="formLabel " >
   

<input value="1" type="checkbox" id="agreed_field" name="tosAccepted" <?php if (!empty($agree_checked)) echo ' checked="checked" '; ?> class="terms-of-service"  required="required" autocomplete="off" />
               <label for="agreed_field"><?php echo OPCLang::_('COM_VIRTUEMART_I_AGREE_TO_TOS');
               if (!empty($tos_link))
               {
               JHTML::_('behavior.modal', 'a.opcmodal');
               
               ?><br /><a target="_blank" rel="{handler: 'iframe', size: {x: 500, y: 400}}" class="opcmodal" href="<?php echo $tos_link; ?>" onclick="javascript: return op_openlink(this); " >(<?php echo OPCLang::_('COM_VIRTUEMART_CART_TOS').' *'; ?>)</a><?php } ?></label>
            
      
   <?php
   
 
?>
   
   </div>



<?php
}


you only need to copy or add a new <a href tag element - BUT let me know if you need a modal, or just a link with pop-up.

if you'd like to have the popup you can use this:
Code: Select all
<a target="_blank" rel="{handler: 'iframe', size: {x: 500, y: 400}}" class="opcmodal" href="<?php echo JRoute(' YOUR NONSEF LINK COMES HERE');  ?>" onclick="javascript: return op_openlink(this); " >YOUR LINK DESCRIPTION COMES HERE</a>


Best regards, stan

Re: Extra link in the cart

PostPosted: Sat May 09, 2015 4:31 am
by estiloss
Thanks Stan,

I solved it. One last question, if I update the component, those changes will be lost?

Re: Extra link in the cart

PostPosted: Mon May 11, 2015 3:24 pm
by admin
hello, all changes in your theme will remain as far as the theme directory is renamed:

/components/com_onepage/themes/YOUR CUSTOM NAME

once altered, you can rename it with opc's button at the display tab "rename theme before update" We try to keep as much backward compatiblity as possible within opc themes.

best regards,stan