Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * Show the product details page
- *
- * @package VirtueMart
- * @subpackage
- * @author Max Milbers, Eugen Stranz
- * @author RolandD,
- * @todo handle child products
- * @link http://www.virtuemart.net
- * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
- * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
- * VirtueMart is free software. This version may have been modified pursuant
- * to the GNU General Public License, and as distributed it includes or
- * is derivative of works licensed under the GNU General Public License or
- * other free or open source software licenses.
- * @version $Id: default.php 7930 2014-05-15 16:06:09Z Milbo $
- */
- // Check to ensure this file is included in Joomla!
- defined('_JEXEC') or die('Restricted access');
- /* Let's see if we found the product */
- if (empty($this->product)) {
- echo vmText::_('COM_VIRTUEMART_PRODUCT_NOT_FOUND');
- echo '<br /><br /> ' . $this->continue_link_html;
- return;
- }
- if(vRequest::getInt('print',false)){
- ?>
- <body onload="javascript:print();">
- <?php }
- // addon for joomla modal Box
- JHtml::_('behavior.modal');
- $MailLink = 'index.php?option=com_virtuemart&view=productdetails&task=recommend&virtuemart_product_id=' . $this->product->virtuemart_product_id . '&virtuemart_category_id=' . $this->product->virtuemart_category_id . '&tmpl=component';
- $boxFuncReco = '';
- $boxFuncAsk = '';
- if(VmConfig::get('usefancy',1)){
- vmJsApi::js( 'fancybox/jquery.fancybox-1.3.4.pack');
- vmJsApi::css('jquery.fancybox-1.3.4');
- if(VmConfig::get('show_emailfriend',0)){
- $boxReco = "jQuery.fancybox({
- href: '" . $MailLink . "',
- type: 'iframe',
- height: '550'
- });";
- }
- if(VmConfig::get('ask_question', 0)){
- $boxAsk = "jQuery.fancybox({
- href: '" . $this->askquestion_url . "',
- type: 'iframe',
- height: '550'
- });";
- }
- } else {
- vmJsApi::js( 'facebox' );
- vmJsApi::css( 'facebox' );
- if(VmConfig::get('show_emailfriend',0)){
- $boxReco = "jQuery.facebox({
- iframe: '" . $MailLink . "',
- rev: 'iframe|550|550'
- });";
- }
- if(VmConfig::get('ask_question', 0)){
- $boxAsk = "jQuery.facebox({
- iframe: '" . $this->askquestion_url . "',
- rev: 'iframe|550|550'
- });";
- }
- }
- if(VmConfig::get('show_emailfriend',0) ){
- $boxFuncReco = "jQuery('a.recommened-to-friend').click( function(){
- ".$boxReco."
- return false ;
- });";
- }
- if(VmConfig::get('ask_question', 0)){
- $boxFuncAsk = "jQuery('a.ask-a-question').click( function(){
- ".$boxAsk."
- return false ;
- });";
- }
- if(!empty($boxFuncAsk) or !empty($boxFuncReco)){
- $document = JFactory::getDocument();
- $document->addScriptDeclaration("
- //<![CDATA[
- jQuery(document).ready(function($) {
- ".$boxFuncReco."
- ".$boxFuncAsk."
- /* $('.additional-images a').mouseover(function() {
- var himg = this.href ;
- var extension=himg.substring(himg.lastIndexOf('.')+1);
- if (extension =='png' || extension =='jpg' || extension =='gif') {
- $('.main-image img').attr('src',himg );
- }
- console.log(extension)
- });*/
- });
- //]]>
- ");
- }
- // This is the rows for the customfields, as long you have only one product, just increase it by one,
- // if you have more than one product, reset it for every product
- $this->row = 0;
- ?>
- <div class="productdetails-view productdetails">
- <?php
- // Product Navigation
- if (VmConfig::get('product_navigation', 1)) {
- ?>
- <div class="product-neighbours">
- <?php
- if (!empty($this->product->neighbours ['previous'][0])) {
- $prev_link = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->neighbours ['previous'][0] ['virtuemart_product_id'] . '&virtuemart_category_id=' . $this->product->virtuemart_category_id, FALSE);
- echo JHtml::_('link', $prev_link, $this->product->neighbours ['previous'][0]
- ['product_name'], array('rel'=>'prev', 'class' => 'previous-page'));
- }
- if (!empty($this->product->neighbours ['next'][0])) {
- $next_link = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->neighbours ['next'][0] ['virtuemart_product_id'] . '&virtuemart_category_id=' . $this->product->virtuemart_category_id, FALSE);
- echo JHtml::_('link', $next_link, $this->product->neighbours ['next'][0] ['product_name'], array('rel'=>'next','class' => 'next-page'));
- }
- ?>
- <div class="clear"></div>
- </div>
- <?php } // Product Navigation END
- ?>
- <?php // Back To Category Button
- if ($this->product->virtuemart_category_id) {
- $catURL = JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id='.$this->product->virtuemart_category_id, FALSE);
- $categoryName = $this->product->category_name ;
- } else {
- $catURL = JRoute::_('index.php?option=com_virtuemart');
- $categoryName = vmText::_('COM_VIRTUEMART_SHOP_HOME') ;
- }
- ?>
- <div class="back-to-category">
- <a href="<?php echo $catURL ?>" class="product-details" title="<?php echo $categoryName ?>"><?php echo vmText::sprintf('COM_VIRTUEMART_CATEGORY_BACK_TO',$categoryName) ?></a>
- </div>
- <?php // Product Title ?>
- <h1><?php echo $this->product->product_name ?></h1>
- <?php // Product Title END ?>
- <?php // afterDisplayTitle Event
- echo $this->product->event->afterDisplayTitle ?>
- <?php
- // Product Edit Link
- echo $this->edit_link;
- // Product Edit Link END
- ?>
- <?php
- // PDF - Print - Email Icon
- if (VmConfig::get('show_emailfriend') || VmConfig::get('show_printicon') || VmConfig::get('pdf_icon')) {
- ?>
- <div class="icons">
- <?php
- $link = 'index.php?tmpl=component&option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->virtuemart_product_id;
- echo $this->linkIcon($link . '&format=pdf', 'COM_VIRTUEMART_PDF', 'pdf_button', 'pdf_icon', false);
- echo $this->linkIcon($link . '&print=1', 'COM_VIRTUEMART_PRINT', 'printButton', 'show_printicon');
- echo $this->linkIcon($MailLink, 'COM_VIRTUEMART_EMAIL', 'emailButton', 'show_emailfriend', false,true,false,'class="recommened-to-friend"');
- ?>
- <div class="clear"></div>
- </div>
- <?php } // PDF - Print - Email Icon END
- ?>
- <?php
- // Product Short Description
- if (!empty($this->product->product_s_desc)) {
- ?>
- <div class="product-short-description">
- <?php
- /** @todo Test if content plugins modify the product description */
- echo nl2br($this->product->product_s_desc);
- ?>
- </div>
- <?php
- } // Product Short Description END
- if (!empty($this->product->customfieldsSorted['ontop'])) {
- $this->position = 'ontop';
- echo $this->loadTemplate('customfields');
- } // Product Custom ontop end
- ?>
- <div>
- <div class="width60 floatleft">
- <?php
- echo $this->loadTemplate('images');
- ?>
- </div>
- <div class="width40 floatright">
- <div class="spacer-buy-area">
- <?php
- // TODO in Multi-Vendor not needed at the moment and just would lead to confusion
- /* $link = JRoute::_('index2.php?option=com_virtuemart&view=virtuemart&task=vendorinfo&virtuemart_vendor_id='.$this->product->virtuemart_vendor_id);
- $text = vmText::_('COM_VIRTUEMART_VENDOR_FORM_INFO_LBL');
- echo '<span class="bold">'. vmText::_('COM_VIRTUEMART_PRODUCT_DETAILS_VENDOR_LBL'). '</span>'; ?><a class="modal" href="<?php echo $link ?>"><?php echo $text ?></a><br />
- */
- ?>
- <?php
- if ($this->showRating) {
- $maxrating = VmConfig::get('vm_maximum_rating_scale', 5);
- if (empty($this->rating)) {
- ?>
- <span class="vote"><?php echo vmText::_('COM_VIRTUEMART_RATING') . ' ' . vmText::_('COM_VIRTUEMART_UNRATED') ?></span>
- <?php
- } else {
- $ratingwidth = $this->rating->rating * 24; //I don't use round as percetntage with works perfect, as for me
- ?>
- <span class="vote">
- <?php echo vmText::_('COM_VIRTUEMART_RATING') . ' ' . round($this->rating->rating) . '/' . $maxrating; ?><br/>
- <span title=" <?php echo (vmText::_("COM_VIRTUEMART_RATING_TITLE") . round($this->rating->rating) . '/' . $maxrating) ?>" class="ratingbox" style="display:inline-block;">
- <span class="stars-orange" style="width:<?php echo $ratingwidth.'px'; ?>">
- </span>
- </span>
- </span>
- <?php
- }
- }
- if (is_array($this->productDisplayShipments)) {
- foreach ($this->productDisplayShipments as $productDisplayShipment) {
- echo $productDisplayShipment . '<br />';
- }
- }
- if (is_array($this->productDisplayPayments)) {
- foreach ($this->productDisplayPayments as $productDisplayPayment) {
- echo $productDisplayPayment . '<br />';
- }
- }
- // Product Price
- // the test is done in show_prices
- //if ($this->show_prices and (empty($this->product->images[0]) or $this->product->images[0]->file_is_downloadable == 0)) {
- echo $this->loadTemplate('showprices');
- //}
- ?>
- <?php
- // Add To Cart Button
- // if (!empty($this->product->prices) and !empty($this->product->images[0]) and $this->product->images[0]->file_is_downloadable==0 ) {
- // if (!VmConfig::get('use_as_catalog', 0) and !empty($this->product->prices['salesPrice'])) {
- echo $this->loadTemplate('addtocart');
- // } // Add To Cart Button END
- ?>
- <?php
- // Availability
- $stockhandle = VmConfig::get('stockhandle', 'none');
- $product_available_date = substr($this->product->product_available_date,0,10);
- $current_date = date("Y-m-d");
- if (($this->product->product_in_stock - $this->product->product_ordered) < 1) {
- if ($product_available_date != '0000-00-00' and $current_date < $product_available_date) {
- ?> <div class="availability">
- <?php echo vmText::_('COM_VIRTUEMART_PRODUCT_AVAILABLE_DATE') .': '. JHtml::_('date', $this->product->product_available_date, vmText::_('DATE_FORMAT_LC4')); ?>
- </div>
- <?php
- } else if ($stockhandle == 'risetime' and VmConfig::get('rised_availability') and empty($this->product->product_availability)) {
- ?> <div class="availability">
- <?php echo (file_exists(JPATH_BASE . DS . VmConfig::get('assets_general_path') . 'images/availability/' . VmConfig::get('rised_availability'))) ? JHtml::image(JURI::root() . VmConfig::get('assets_general_path') . 'images/availability/' . VmConfig::get('rised_availability', '7d.gif'), VmConfig::get('rised_availability', '7d.gif'), array('class' => 'availability')) : vmText::_(VmConfig::get('rised_availability')); ?>
- </div>
- <?php
- } else if (!empty($this->product->product_availability)) {
- ?>
- <div class="availability">
- <?php echo (file_exists(JPATH_BASE . DS . VmConfig::get('assets_general_path') . 'images/availability/' . $this->product->product_availability)) ? JHtml::image(JURI::root() . VmConfig::get('assets_general_path') . 'images/availability/' . $this->product->product_availability, $this->product->product_availability, array('class' => 'availability')) : vmText::_($this->product->product_availability); ?>
- </div>
- <?php
- }
- }
- else if ($product_available_date != '0000-00-00' and $current_date < $product_available_date) {
- ?> <div class="availability">
- <?php echo vmText::_('COM_VIRTUEMART_PRODUCT_AVAILABLE_DATE') .': '. JHtml::_('date', $this->product->product_available_date, vmText::_('DATE_FORMAT_LC4')); ?>
- </div>
- <?php
- }
- ?>
- <?php
- // Ask a question about this product
- if (VmConfig::get('ask_question', 0) == 1) {
- ?>
- <div class="ask-a-question">
- <a class="ask-a-question" href="<?php echo $this->askquestion_url ?>" rel="nofollow" ><?php echo vmText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL') ?></a>
- <!--<a class="ask-a-question modal" rel="{handler: 'iframe', size: {x: 700, y: 550}}" href="<?php echo $this->askquestion_url ?>"><?php echo vmText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL') ?></a>-->
- </div>
- <?php }
- ?>
- <?php
- // Manufacturer of the Product
- if (VmConfig::get('show_manufacturers', 1) && !empty($this->product->virtuemart_manufacturer_id)) {
- echo $this->loadTemplate('manufacturer');
- }
- ?>
- </div>
- </div>
- <div class="clear"></div>
- </div>
- <?php
- $count_images = count ($this->product->images);
- if ($count_images > 1) {
- echo $this->loadTemplate('images_additional');
- }
- // event onContentBeforeDisplay
- echo $this->product->event->beforeDisplayContent; ?>
- <?php
- // Product Description
- if (!empty($this->product->product_desc)) {
- ?>
- <div class="product-description">
- <?php /** @todo Test if content plugins modify the product description */ ?>
- <span class="title"><?php echo vmText::_('COM_VIRTUEMART_PRODUCT_DESC_TITLE') ?></span>
- <?php echo $this->product->product_desc; ?>
- </div>
- <?php
- } // Product Description END
- if (!empty($this->product->customfieldsSorted['normal'])) {
- $this->position = 'normal';
- echo $this->loadTemplate('customfields');
- } // Product custom_fields END
- // Product Packaging
- $product_packaging = '';
- if ($this->product->product_box) {
- ?>
- <div class="product-box">
- <?php
- echo vmText::_('COM_VIRTUEMART_PRODUCT_UNITS_IN_BOX') .$this->product->product_box;
- ?>
- </div>
- <?php } // Product Packaging END
- // Show child categories
- if (VmConfig::get('showCategory', 1)) {
- echo $this->loadTemplate('showcategory');
- }
- if (!empty($this->product->customfieldsSorted['onbot'])) {
- $this->position='onbot';
- echo $this->loadTemplate('customfields');
- } // Product Custom ontop end
- if (!empty($this->product->customfieldsSorted['related_products'])) {
- $this->position = 'related_products';
- echo $this->loadTemplate('customfields');
- }
- if (!empty($this->product->customfieldsSorted['related_categories'])) {
- $this->position = 'related_categories';
- echo $this->loadTemplate('customfields');
- }
- ?>
- <?php // onContentAfterDisplay event
- echo $this->product->event->afterDisplayContent; ?>
- <?php
- echo $this->loadTemplate('reviews');
- ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment