Advertisement
vikasrao999

Untitled

Jun 17th, 2014
524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.73 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. if($_product->getTypeId() == 'grouped')
  38. {
  39. ?>
  40.  
  41. <style>
  42. .add-to-cart button.button{
  43. display:none !important;
  44. }
  45. </style>
  46. <?php
  47. }
  48. ?>
  49.  
  50. <?php if($this->helper('framework')->getprevnextbutton()):?>
  51. <?php $prev_url = $next_url = $url = $_product->getProductUrl();
  52. if ($this->helper('catalog/data')->getCategory()) {
  53. $category = $this->helper('catalog/data')->getCategory();
  54. } else {
  55. $_ccats = $this->helper('catalog/data')->getProduct()->getCategoryIds();
  56. $category = Mage::getModel('catalog/category')->load($_ccats[0]);
  57. }
  58.  
  59. $children = $category->getProductCollection();
  60. $_count = is_array($children) ? count($children) : $children->count();
  61. if ($_count) {
  62. foreach ($children as $product) {
  63. $plist[] = $product->getId();
  64. }
  65.  
  66. /**
  67. * Determine the previous/next link and link to current category
  68. */
  69. $current_pid = $this->helper('catalog/data')->getProduct()->getId();
  70. $curpos = array_search($current_pid, $plist);
  71. // get link for prev product
  72. $previd = isset($plist[$curpos+1])? $plist[$curpos+1] : $current_pid;
  73. $product = Mage::getModel('catalog/product')->load($previd);
  74. $prevpos = $curpos;
  75. while (!$product->isVisibleInCatalog()) {
  76. $prevpos += 1;
  77. $nextid = isset($plist[$prevpos])? $plist[$prevpos] : $current_pid;
  78. $product = Mage::getModel('catalog/product')->load($nextid);
  79. }
  80. $prev_url = $product->getProductUrl();
  81. // get link for next product
  82. $nextid = isset($plist[$curpos-1])? $plist[$curpos-1] : $current_pid;
  83. $product = Mage::getModel('catalog/product')->load($nextid);
  84. $nextpos = $curpos;
  85. while (!$product->isVisibleInCatalog()) {
  86. $nextpos -= 1;
  87. $nextid = isset($plist[$nextpos])? $plist[$nextpos] : $current_pid;
  88. $product = Mage::getModel('catalog/product')->load($nextid);
  89. }
  90. $next_url = $product->getProductUrl();
  91. $more_url = $category->getUrl();
  92. }
  93. ?>
  94. <?php endif; ?>
  95.  
  96.  
  97. <script type="text/javascript">
  98. var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
  99. </script>
  100. <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
  101. <article class="product-view">
  102. <div class="product-essential">
  103. <form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
  104. <div class="no-display">
  105. <input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
  106. <input type="hidden" name="related_product" id="related-products-field" value="" />
  107. </div>
  108.  
  109.  
  110. <div class="product-img-box">
  111. <?php echo $this->getChildHtml('media') ?>
  112. </div>
  113.  
  114.  
  115. <div itemscope="" itemtype="http://schema.org/Product" class="product-shop <?php if($this->helper('framework')->getEnableThirdColumn()): echo ' info3col'; endif; ?>">
  116. <div class="product-name">
  117. <h1 itemprop="name" class="item name fn"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>
  118.  
  119.  
  120. <!--############################ PREV NEXT OUTPUT ##################################-->
  121. <?php if($this->helper('framework')->getprevnextbutton()):?>
  122. <div id="prev-next-links">
  123. <!--Previous Item Link-->
  124. <?php if ($url <> $next_url):?>
  125. <a id="link-previous-product" href="<?php echo $next_url; ?>">&nbsp;</a>
  126. <?php endif; ?>
  127. <!--Next Item Link-->
  128. <?php if ($url <> $prev_url):?>
  129. <a id="link-next-product" href="<?php echo $prev_url; ?>">&nbsp;</a>
  130.  
  131. <?php endif; ?>
  132. </div>
  133. <?php endif; ?>
  134. <!--############################ END PREV NEXT OUTPUT ##################################-->
  135.  
  136. <?php echo $this->getReviewsSummaryHtml($_product, false, true)?>
  137.  
  138. </div>
  139.  
  140.  
  141. <div class="clearer"></div>
  142.  
  143. <?php echo $this->getChildHtml('alert_urls') ?>
  144. <div class="clearer"></div>
  145.  
  146. <?php if($this->helper('framework')->displayquickview()):?>
  147. <?php if ($_product->getShortDescription()):?>
  148. <div class="short-description" itemprop="description">
  149. <?php /*?><h2><?php echo $this->__('Quick Overview') ?></h2><?php */?>
  150. <div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
  151. </div>
  152. <?php endif;?>
  153. <?php endif; ?>
  154.  
  155. <div>
  156. <?php echo $this->getChildHtml('product_type_data') ?>
  157. <?php echo $this->getTierPriceHtml() ?>
  158. </div>
  159.  
  160. <div class="clearer"></div>
  161. <?php echo $this->getChildHtml('extrahint') ?>
  162.  
  163.  
  164.  
  165.  
  166. <?php echo $this->getChildHtml('other');?>
  167.  
  168. <?php if ($_product->isSaleable() && $this->hasOptions()):?>
  169. <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
  170. <?php endif;?>
  171.  
  172. <div id="product_bottom_option">
  173. <?php if ($_product->isSaleable() && $this->hasOptions()):?>
  174. <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
  175. <?php endif;?>
  176. </div>
  177.  
  178.  
  179. <?php if (!$this->hasOptions()):?>
  180. <div class="add-to-box">
  181. <?php if($_product->isSaleable()): ?>
  182. <?php echo $this->getChildHtml('addtocart') ?>
  183. <?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
  184. <span class="or"><?php echo $this->__('OR') ?></span>
  185. <?php endif; ?>
  186. <?php endif; ?>
  187.  
  188. </div>
  189. <?php echo $this->getChildHtml('extra_buttons') ?>
  190. <?php elseif (!$_product->isSaleable()): ?>
  191. <div class="add-to-box">
  192. <?php echo $this->getChildHtml('addto') ?>
  193. </div>
  194. <?php endif; ?>
  195.  
  196. <div class="email_wishlist_box">
  197. <?php if ($this->canEmailToFriend()): ?>
  198. <p class="email-friend"><a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>">
  199. <?php echo $this->__('Email to a Friend') ?></a></p>
  200.  
  201. <?php echo $this->getChildHtml('addto') ?>
  202. <?php endif; ?>
  203. </div>
  204.  
  205. <?php /** ----- Social Icon Setting ------*/?>
  206. <?php if($this->helper('framework')->getSocialIconScript()):?>
  207. <?php echo $this->helper('framework')->getSocialIconScript();?>
  208. <?php else: ?>
  209. <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('tm_infopage_social_icon')->toHtml();?>
  210. <?php endif;?>
  211. <?php /** ----------*/?>
  212.  
  213. </div>
  214.  
  215. <?php /** ----- Infopage Third Column Setting ------*/?>
  216. <?php if($this->helper('framework')->getEnableThirdColumn()):?>
  217. <div class="info3col-data">
  218. <?php
  219. $content = split(',', $this->helper('framework')->getColumnContent());
  220. foreach ($content as $k=>$val){
  221. if($val == 'related_products'):
  222. echo $this->getChildHtml('catalog.product.related');
  223. endif;
  224. if($val == 'static_block_content'): ?>
  225. <div class="custom_block">
  226. <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('tm_infopage_thirdcol_block')->toHtml(); ?>
  227. </div>
  228. <?php
  229. endif;
  230. if($val == 'dynamic_attribute_content'):
  231. echo $this->helper('framework')->getProductAttributeCode($_product);
  232. endif;
  233. if($val == 'upsell_product'):
  234. echo $this->getChildHtml('upsell_products_list');
  235. endif;
  236. }
  237. ?>
  238. </div>
  239. <?php endif; ?>
  240. <?php /** ----- Infopage Third Column Setting ------*/?>
  241.  
  242. <div class="clearer"></div>
  243.  
  244. </form>
  245. <script type="text/javascript">
  246. //<![CDATA[
  247. var productAddToCartForm = new VarienForm('product_addtocart_form');
  248. productAddToCartForm.submit = function(button, url) {
  249. if (this.validator.validate()) {
  250. var form = this.form;
  251. var oldUrl = form.action;
  252.  
  253. if (url) {
  254. form.action = url;
  255. }
  256. var e = null;
  257. try {
  258. this.form.submit();
  259. } catch (e) {
  260. }
  261. this.form.action = oldUrl;
  262. if (e) {
  263. throw e;
  264. }
  265.  
  266. if (button && button != 'undefined') {
  267. button.disabled = true;
  268. }
  269. }
  270. }.bind(productAddToCartForm);
  271.  
  272. productAddToCartForm.submitLight = function(button, url){
  273. if(this.validator) {
  274. var nv = Validation.methods;
  275. delete Validation.methods['required-entry'];
  276. delete Validation.methods['validate-one-required'];
  277. delete Validation.methods['validate-one-required-by-name'];
  278. // Remove custom datetime validators
  279. for (var methodName in Validation.methods) {
  280. if (methodName.match(/^validate-datetime-.*/i)) {
  281. delete Validation.methods[methodName];
  282. }
  283. }
  284.  
  285. if (this.validator.validate()) {
  286. if (url) {
  287. this.form.action = url;
  288. }
  289. this.form.submit();
  290. }
  291. Object.extend(Validation.methods, nv);
  292. }
  293. }.bind(productAddToCartForm);
  294. //]]>
  295. </script>
  296. </div>
  297.  
  298. <div class="product-collateral">
  299.  
  300.  
  301. <?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
  302. <div class="box-collateral <?php echo "box-{$alias}"?>">
  303. <?php if ($title = $this->getChildData($alias, 'title')):?>
  304. <h2><?php echo $this->escapeHtml($title); ?></h2>
  305. <?php endif;?>
  306. <?php echo $html; ?>
  307. </div>
  308. <?php endforeach;?>
  309.  
  310. <?php echo $this->getChildHtml('upsell_products') ?>
  311.  
  312.  
  313. <?php if(!$this->helper('framework')->getrelatedproducttab()):?>
  314. <?php echo $this->getChildHtml('related_products') ?>
  315. <?php endif;?>
  316.  
  317.  
  318.  
  319. </div>
  320. </article>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement