Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2017
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.54 KB | None | 0 0
  1. <?php
  2. /**
  3.  *
  4.  * Show the product details page
  5.  *
  6.  * @package    VirtueMart
  7.  * @subpackage
  8.  * @author Max Milbers, Valerie Isaksen
  9.  * @todo handle child products
  10.  * @link http://www.virtuemart.net
  11.  * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
  12.  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
  13.  * VirtueMart is free software. This version may have been modified pursuant
  14.  * to the GNU General Public License, and as distributed it includes or
  15.  * is derivative of works licensed under the GNU General Public License or
  16.  * other free or open source software licenses.
  17.  * @version $Id: default_addtocart.php 7833 2014-04-09 15:04:59Z Milbo $
  18.  */
  19. // Check to ensure this file is included in Joomla!
  20. defined('_JEXEC') or die('Restricted access');
  21. $product = $viewData['product'];
  22.  
  23. if(isset($viewData['rowHeights'])){
  24.     $rowHeights = $viewData['rowHeights'];
  25. } else {
  26.     $rowHeights['customfields'] = TRUE;
  27. }
  28.  
  29. if(isset($viewData['position'])){
  30.     $positions = $viewData['position'];
  31. } else {
  32.     $positions = 'addtocart';
  33. }
  34. if(!is_array($positions)) $positions = array($positions);
  35.  
  36. $addtoCartButton = '';
  37. if(!VmConfig::get('use_as_catalog', 0)){
  38.     if($product->addToCartButton){
  39.         $addtoCartButton = $product->addToCartButton;
  40.     } else {
  41.         $addtoCartButton = shopFunctionsF::getAddToCartButton ($product->orderable);
  42.     }
  43.  
  44. }
  45.  
  46. ?>
  47.     <div class="addtocart-area">
  48.         <form method="post" class="product js-recalculate" action="<?php echo JRoute::_ ('index.php?option=com_virtuemart',false); ?>">
  49.             <div class="vm-customfields-wrap">
  50.                 <?php
  51.                 if(!empty($rowHeights['customfields'])) {
  52.                     foreach($positions as $pos){
  53.                         echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$product,'position'=>$pos));
  54.                     }
  55.                 } ?>
  56.             </div>         
  57.                 <?php
  58.                 if (!VmConfig::get('use_as_catalog', 0)  ) {
  59.                     echo shopFunctionsF::renderVmSubLayout('addtocartbar',array('product'=>$product));
  60.                 } ?>
  61.             <input type="hidden" name="option" value="com_virtuemart"/>
  62.             <input type="hidden" name="view" value="cart"/>
  63.             <input type="hidden" name="virtuemart_product_id[]" value="<?php echo $product->virtuemart_product_id ?>"/>
  64.             <input type="hidden" name="pname" value="<?php echo $product->product_name ?>"/>
  65.             <input type="hidden" name="pid" value="<?php echo $product->virtuemart_product_id ?>"/>
  66.             <?php
  67.             $itemId=vRequest::getInt('Itemid',false);
  68.             if($itemId){
  69.                 echo '<input type="hidden" name="Itemid" value="'.$itemId.'"/>';
  70.             } ?>
  71.         </form>
  72.  
  73.     </div>
  74.  
  75. <?php // }
  76. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement