TOPIC: Pdf in new window

Pdf in new window 10 years 2 months ago #3481

The question I have is about PDF creation on product page. When I press a small pdf icon pdf opens in the same window, I want it open in new window.

I tried, but I can not find how to get it.
The administrator has disabled public write access.

Re: Pdf in new window 10 years 2 months ago #3500

  • trungdt
  • trungdt's Avatar
  • OFFLINE
  • Administrator
  • Posts: 2284
  • Thank you received: 998
  • Karma: 121
Hello,

It's from VM core, you can edit that function as below(components/com_virtuemart/helpers/vmview.php):
class VmView extends JView{

	function linkIcon($link,$altText ='',$boutonName,$verifyConfigValue=false, $modal = true, $use_icon=true,$use_text=false){
		if ($verifyConfigValue) {
			if ( !VmConfig::get($verifyConfigValue, 0) ) return '';
		}
		$folder = (JVM_VERSION===1) ? '/images/M_images/' : '/media/system/images/';
		$text='';
		if ( $use_icon ) $text .= JHtml::_('image.site', $boutonName.'.png', $folder, null, null, JText::_($altText));
		if ( $use_text ) $text .= ' '. JText::_($altText);
		if ( $text=='' )  $text .= ' '. JText::_($altText);
		if ($modal) return '<a class="modal" rel="{handler: \'iframe\', size: {x: 700, y: 550}}" title="'. JText::_($altText).'" href="'.JRoute::_($link).'">'.$text.'</a>';
		else 		return '<a title="'. JText::_($altText).'" href="'.JRoute::_($link).'">'.$text.'</a>';
	}

}

Change to this
class VmView extends JView{

	function linkIcon($link,$altText ='',$boutonName,$verifyConfigValue=false, $modal = true, $use_icon=true,$use_text=false){
		if ($verifyConfigValue) {
			if ( !VmConfig::get($verifyConfigValue, 0) ) return '';
		}
		$folder = (JVM_VERSION===1) ? '/images/M_images/' : '/media/system/images/';
		$text='';
		if ( $use_icon ) $text .= JHtml::_('image.site', $boutonName.'.png', $folder, null, null, JText::_($altText));
		if ( $use_text ) $text .= '&nbsp;'. JText::_($altText);
		if ( $text=='' )  $text .= '&nbsp;'. JText::_($altText);
		if ($modal) return '<a target="_blank" class="modal" rel="{handler: \'iframe\', size: {x: 700, y: 550}}" title="'. JText::_($altText).'" href="'.JRoute::_($link).'">'.$text.'</a>';
		else 		return '<a title="'. JText::_($altText).'" href="'.JRoute::_($link).'" target="_blank">'.$text.'</a>';
	}

}

Thanks
Last Edit: 10 years 2 months ago by trungdt.
The administrator has disabled public write access.

Re: Pdf in new window 10 years 2 months ago #3524

Thank you very much, it works perfectly.
The administrator has disabled public write access.
Time to create page: 0.097 seconds