Author Topic: [solved] Function PrintIcon does not work in VM1.1.9  (Read 1517 times)

mowlman

  • Jr. Member
  • **
  • Posts: 209
[solved] Function PrintIcon does not work in VM1.1.9
« on: July 16, 2012, 21:48:01 pm »
After upgrading to 1.1.9 ,
The PRINT ICON just opens up in a new window with the same Account Maintenance page again.

Not sure if all of the changes were for security purposes or not, but it no longer works. I've also tried with sh404SEF turned off.

************************************************************************************
EDITED TO INCLUDE FIX:
RESOLUTION:
Was missing the order_id parameters from line 27 of
\components\com_virtuemart\themes\YOUR_TEMPLATE_NAME\templates\pages\account.order_details.tpl.php

<?php echo vmCommonHTML::PrintIcon('order_id='.$vars["order_id"]); ?>

**************************************************************************************************


The non sef link displayed for one of my orders is:
http://www.completecabinethardware.com/index2.php?option=com_virtuemart&page=account.order_details&only_page=1&pop=1&tmpl=component&

File Path: \administrator\components\com_virtuemart\classes\htmlTools.class.php

Any ideas?
Here is the function:
Code: [Select]
function PrintIcon( $addlink='', $use_icon=true, $add_text='' ) {
global $VM_LANG, $mosConfig_live_site, $mosConfig_absolute_path, $cur_template, $Itemid;
if ( @VM_SHOW_PRINTICON == '1' ) {
if (substr($addlink, 0, 10) == "index2.php") {
$link = $addlink ;

} else {
$query_string= "option=com_virtuemart&amp;page={$_SESSION['last_page']}&amp;only_page=1";
if ($_SESSION['last_browse_parameters']['category_id'])  $query_string.= "&amp;category_id={$_SESSION['last_browse_parameters']['category_id']}";
if ($_SESSION['userstate']['product_id']) $query_string.= "&amp;product_id={$_SESSION['userstate']['product_id']}";
                                            if ($_SESSION['userstate']['order_id']) $query_string.= "&amp;order_id={$_SESSION['userstate']['order_id']}";
$link = 'index2.php?'.$query_string.'&amp;pop=1'.(vmIsJoomla('1.5') ? '&amp;tmpl=component' : '');
$link .= '&amp;'.$addlink ;
}

// checks template image directory for image, if non found default are loaded
if ( $use_icon ) {
$text = vmCommonHTML::ImageCheck( 'printButton.png', '/images/M_images/', NULL, NULL, $VM_LANG->_('CMN_PRINT'), $VM_LANG->_('CMN_PRINT') );
$text .= shopMakeHtmlSafe($add_text);
} else {
$text = '|&nbsp;'. $VM_LANG->_('CMN_PRINT'). '&nbsp;|';
}
$isPopup = vmGet( $_GET, 'pop' );
if ( $isPopup ) {
// Print Preview button - used when viewing page
$html = '<span class="vmNoPrint">
<a href="javascript:void(0)" onclick="javascript:window.print(); return false;" title="'. $VM_LANG->_('CMN_PRINT').'">
'. $text .'
</a></span>';
return $html;
} else {
// Print Button - used in pop-up window
return vmPopupLink($link, $text, 640, 480, '_blank', $VM_LANG->_('CMN_PRINT'));
}
}

}

I even tried adding
Code: [Select]
if ($_SESSION['userstate']['order_id']) $query_string.= "&amp;order_id={$_SESSION['userstate']['order_id']}";
as posted in topic: http://forum.virtuemart.net/index.php?topic=90661.0

I really do not want to go back to the 2009 version of this file, Anyone have an idea?
Thanks.