Advertisement
vikasrao999

view.phtml

Jul 10th, 2014
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.84 KB | None | 0 0
  1. <?php
  2. /**
  3. * Magento
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Academic Free License (AFL 3.0)
  8. * that is bundled with this package in the file LICENSE_AFL.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/afl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@magentocommerce.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade Magento to newer
  18. * versions in the future. If you wish to customize Magento for your
  19. * needs please refer to http://www.magentocommerce.com for more information.
  20. *
  21. * @category design
  22. * @package base_default
  23. * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
  24. * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
  25. */
  26.  
  27. /**
  28. * Product view template
  29. *
  30. * @see Mage_Catalog_Block_Product_View
  31. * @see Mage_Review_Block_Product_View
  32. */
  33. ?>
  34. <?php $_helper = $this->helper('catalog/output'); ?>
  35. <?php $_product = $this->getProduct(); ?>
  36. <?php
  37. $pageLayout = substr((str_replace(array('page/','.phtml'),'',Mage::app()->getLayout()->getBlock('root')->getTemplate())),0,1);
  38. $imgProduct = 'grid_9 alpha';
  39. $detailProduct = 'grid_10 omega';
  40. switch ($pageLayout){
  41. case 1: $imgProduct='grid_10 alpha';
  42. $detailProduct='grid_14 omega';
  43. break;
  44. case 3: $imgProduct='grid_7 alpha';
  45. $detailProduct='grid_7 omega';
  46. break;
  47. }
  48. ?>
  49. <script type="text/javascript">
  50. var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
  51. </script>
  52. <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
  53. <div class="product-view">
  54. <div class="product-essential">
  55. <form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
  56. <div class="no-display">
  57. <input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
  58. <input type="hidden" name="related_product" id="related-products-field" value="" />
  59. </div>
  60.  
  61. <div class="product-img-box <?php echo $imgProduct?>" style="margin-right: 0;">
  62. <?php echo $this->getChildHtml('media') ?>
  63. </div>
  64.  
  65. <div class="product-shop <?php echo $detailProduct?>">
  66. <?php list($_prev_prod, $_next_prod) = Mage::helper('galagiftshopsettings/product')->getPreviousNextProducts($this->getProduct()); ?>
  67.  
  68. <?php if($_prev_prod != NULL): ?>
  69. <a href="<?php echo $_prev_prod->getProductUrl(); ?>" class="prev-product" title="Previous Products"><?php echo $this->__('Previous') ?></a>
  70. <?php endif; ?>
  71.  
  72. <?php if($_next_prod != NULL): ?>
  73. <a href="<?php echo $_next_prod->getProductUrl(); ?>" class="next-product" title="Next Products"><?php echo $this->__('Next') ?></a>
  74. <?php endif; ?>
  75.  
  76. <div class="product-name">
  77. <h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
  78. </div>
  79. <?php if ($this->canEmailToFriend()): ?>
  80. <p class="email-friend"><a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a></p>
  81. <?php endif; ?>
  82. <?php echo $this->getReviewsSummaryHtml($_product, false, true)?>
  83. <?php if ($_product->getShortDescription()):?>
  84. <div class="short-description">
  85. <h2><?php echo $this->__('Quick Overview') ?></h2>
  86. <div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
  87. </div>
  88. <?php endif;?>
  89.  
  90. <?php echo $this->getChildHtml('alert_urls') ?>
  91. <?php echo $this->getChildHtml('product_type_data') ?>
  92. <?php echo $this->getTierPriceHtml() ?>
  93. <?php echo $this->getChildHtml('extrahint') ?>
  94.  
  95. <?php if (!$this->hasOptions()):?>
  96. <div class="add-to-box">
  97. <?php if($_product->isSaleable()): ?>
  98. <?php echo $this->getChildHtml('addtocart') ?>
  99. <?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
  100. <span class="or"><?php echo $this->__('OR') ?></span>
  101. <?php endif; ?>
  102. <?php endif; ?>
  103. <?php echo $this->getChildHtml('addto') ?>
  104. </div>
  105. <?php echo $this->getChildHtml('extra_buttons') ?>
  106. <?php elseif (!$_product->isSaleable()): ?>
  107. <div class="add-to-box">
  108. <?php echo $this->getChildHtml('addto') ?>
  109. </div>
  110. <?php endif; ?>
  111.  
  112. <?php echo $this->getChildHtml('other');?>
  113. <?php echo $this->getChildHtml('galagiftshop_details_ad');?>
  114.  
  115. <?php if ($_product->isSaleable() && $this->hasOptions()):?>
  116. <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
  117. <?php endif;?>
  118.  
  119. </div>
  120. <div class="clearer"></div>
  121. <?php if ($_product->isSaleable() && $this->hasOptions()):?>
  122. <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
  123. <?php endif;?>
  124. </form>
  125. <?php if (Mage::helper('galagiftshopsettings')->getGeneral_DisableSocial()==0): ?>
  126. <div id="social-share" class="hide-lte0 hide-lte1 hide-lte2"></div>
  127. <script type="text/javascript">
  128. jQuery(document).ready(function($){
  129. jQuery('#social-share').dcSocialShare({
  130. buttons: 'facebook,plusone,twitter,pinterest',
  131. twitterId: 'designchemical',
  132. email: 'moc//niamod/liame',
  133. align: 'right',
  134. floater: false
  135. });
  136. });
  137. </script>
  138. <?php endif; ?>
  139. <script type="text/javascript">
  140. //<![CDATA[
  141. var productAddToCartForm = new VarienForm('product_addtocart_form');
  142. productAddToCartForm.submit = function(button, url) {
  143. if (this.validator.validate()) {
  144. var form = this.form;
  145. var oldUrl = form.action;
  146.  
  147. if (url) {
  148. form.action = url;
  149. }
  150. var e = null;
  151. try {
  152. this.form.submit();
  153. } catch (e) {
  154. }
  155. this.form.action = oldUrl;
  156. if (e) {
  157. throw e;
  158. }
  159.  
  160. if (button && button != 'undefined') {
  161. button.disabled = true;
  162. }
  163. }
  164. }.bind(productAddToCartForm);
  165.  
  166. productAddToCartForm.submitLight = function(button, url){
  167. if(this.validator) {
  168. var nv = Validation.methods;
  169. delete Validation.methods['required-entry'];
  170. delete Validation.methods['validate-one-required'];
  171. delete Validation.methods['validate-one-required-by-name'];
  172. // Remove custom datetime validators
  173. for (var methodName in Validation.methods) {
  174. if (methodName.match(/^validate-datetime-.*/i)) {
  175. delete Validation.methods[methodName];
  176. }
  177. }
  178.  
  179. if (this.validator.validate()) {
  180. if (url) {
  181. this.form.action = url;
  182. }
  183. this.form.submit();
  184. }
  185. Object.extend(Validation.methods, nv);
  186. }
  187. }.bind(productAddToCartForm);
  188. //]]>
  189. </script>
  190. </div>
  191.  
  192. <div class="product-collateral">
  193. <?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
  194. <div class="box-collateral <?php echo "box-{$alias}"?>">
  195. <?php if ($title = $this->getChildData($alias, 'title')):?>
  196. <h2><?php echo $this->escapeHtml($title); ?></h2>
  197. <?php endif;?>
  198. <?php echo $html; ?>
  199. </div>
  200. <?php endforeach;?>
  201. <?php echo $this->getChildHtml('related_content');?>
  202. <?php echo $this->getChildHtml('review_list') ?>
  203. <?php echo $this->getChildHtml('product_additional_data') ?>
  204. </div>
  205. <?php echo $this->getChildHtml('upsell_products') ?>
  206. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement