Guest User

view

a guest
Apr 8th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.54 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 Them - 1
  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@magento.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.magento.com for more information.
  20. *
  21. * @category design
  22. * @package rwd_default
  23. * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.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.  
  35. <?php $_helper = $this->helper('catalog/output');
  36. $_product = $this->getProduct();
  37. ?>
  38.  
  39. <script type="text/javascript">
  40. var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
  41. </script>
  42. <div id="messages_product_view"><?php echo $this->getMessagesBlock()->toHtml() ?></div>
  43. <div class="product-view">
  44. <div class="product-essential" style="padding:10px 10px 10px;">
  45. <form action="<?php echo $this->getSubmitUrl($_product, array('_secure' => $this->_isSecure())) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
  46. <?php echo $this->getBlockHtml('formkey') ?>
  47. <div class="no-display">
  48. <input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
  49. <input type="hidden" name="related_product" id="related-products-field" value="" />
  50. </div>
  51.  
  52. <div class="product-img-box" style="width:40%;">
  53. <div class="product-name">
  54. <h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
  55. </div>
  56.  
  57. <a target ="_blank" href="http://pinterest.com/pin/create/button/?url=<?php echo trim(Mage::registry('current_product')->getProductUrl()); ?>&media=<?php echo trim($this->helper('catalog/image')->init($_product, 'image')); ?>&description=<?php echo trim(Mage::registry('current_product')->getName()); ?>" class="pin-it-button" count-layout="horizontal">
  58. <img src ="<?php echo $this->getSkinUrl('images/pin.png') ?>"/></a>
  59. <?php echo $this->getChildHtml('media') ?>
  60.  
  61. </div>
  62.  
  63. <div class="product-shop">
  64. <div class="product-name">
  65. <span class="h1">
  66. <?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></span>
  67. </div>
  68.  
  69. <?php echo $this->getChildHtml('aitcg_js_styles1'); ?>
  70.  
  71.  
  72. <div class="price-info">
  73. <?php echo $this->getPriceHtml($_product);
  74. echo $this->getChildHtml('bundle_prices');
  75. echo $this->getTierPriceHtml(); ?>
  76. </div>
  77. <?php $_price = $_product->getPrice();
  78. $_finalPrice =$_product->getFinalPrice();
  79. if($_price > $_finalPrice){?>
  80. <div class="save-me">
  81. <?php if($_finalPrice < $_price):
  82. $_savePercent = 100 - round(($_finalPrice / $_price) * 100);
  83. $_saveAmount = number_format(($_price - $_finalPrice), 2);
  84. echo $_savePercent; ?>%<br/>
  85. <span>OFF</span>
  86. <?php endif; ?>
  87. </div>
  88. <?php }?>
  89. <div class="dinfo">
  90. <?php echo $attribute_value = $_product->getData('delivery_info');?>
  91. </div>
  92. <?php echo $this->getChildHtml('alert_urls');
  93. echo $this->getChildHtml('other');
  94. if ($_product->isSaleable() && $this->hasOptions()):
  95. echo $this->getChildChildHtml('container1', '', true, true);
  96. endif; ?>
  97. <?php if($_product->getAttributeText('pre_order')=='yes')
  98. {
  99. echo "Pre Order ends in";
  100. }
  101. $end_datetime=$_product->getEcomdevExpiryDate();
  102. $date = date( "Y/m/d H:i:s",strtotime($end_datetime));
  103. $endstr= date(strtotime($date));
  104. $nowstr = Mage::getModel('core/date')->timestamp(time());
  105. $now = date('Y/m/d H:i:s', $nowstr); ?>
  106. <span id="countdown" class="countdown"></span>
  107. </div>
  108. <div class="add-to-cart-wrapper">
  109. <?php echo $this->getChildHtml('product_type_data') ?>
  110. <?php echo $this->getChildHtml('extrahint') ?>
  111. <?php if (!$this->hasOptions()):?>
  112. <div class="add-to-box">
  113. <?php if($_product->isSaleable()):
  114. // echo $this->getChildHtml('addtocart');
  115. if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)):?>
  116. <span class="or"><?php echo $this->__('OR') ?></span>
  117. <?php endif;
  118. endif; ?>
  119.  
  120. </div>
  121. <?php //echo $this->getChildHtml('extra_buttons');
  122. elseif (!$_product->isSaleable()): ?>
  123. <div class="add-to-box">
  124. <?php //echo $this->getChildHtml('addto');
  125. echo $this->getChildHtml('sharing') ?>
  126. </div>
  127. <?php endif; ?>
  128. </div>
  129. <?php echo $this->getChildHtml('related_products') ?>
  130. <div class="clearer"></div>
  131. <?php if ($_product->isSaleable() && $this->hasOptions()):
  132. echo $this->getChildChildHtml('container2', '', true, true);
  133. endif;?>
  134. </form>
  135.  
  136.  
  137.  
  138. <script type="text/javascript">
  139.  
  140.  
  141. var productAddToCartForm = new VarienForm('product_addtocart_form');
  142.  
  143. /*
  144. productAddToCartForm.submit = function(button, url) {
  145.  
  146. var form = this.form;
  147. var oldUrl = form.action;
  148.  
  149. if (url) {
  150. form.action = url;
  151. }
  152. var e = null;
  153. try {
  154. this.form.submit();
  155. } catch (e) {
  156. }
  157. this.form.action = oldUrl;
  158. if (e) {
  159. throw e;
  160. }
  161.  
  162. if (button && button != 'undefined') {
  163. button.disabled = true;
  164. }
  165.  
  166. }.bind(productAddToCartForm);
  167. */
  168.  
  169.  
  170. productAddToCartForm.submitLight = function(button, url){
  171. if(this.validator) {
  172. var nv = Validation.methods;
  173. delete Validation.methods['required-entry'];
  174. delete Validation.methods['validate-one-required'];
  175. delete Validation.methods['validate-one-required-by-name'];
  176.  
  177. for (var methodName in Validation.methods) {
  178.  
  179. if (methodName.match(/^validate-datetime-.*/i)) {
  180.  
  181. delete Validation.methods[methodName];
  182. }
  183. }
  184.  
  185. if (this.validator.validate()) {
  186. if (url) {
  187. this.form.action = url;
  188. }
  189. this.form.submit();
  190. }
  191. Object.extend(Validation.methods, nv);
  192. }
  193. }.bind(productAddToCartForm);
  194.  
  195.  
  196. //]]>
  197.  
  198. </script>
  199.  
  200. </div>
  201. <div class="product-collateral toggle-content">
  202. <?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>
  203. <dl id="collateral-tabs" class="collateral-tabs">
  204. <?php foreach ($detailedInfoGroup as $alias => $html):?>
  205. <dt class="tab"><span><?php echo $this->escapeHtml($this->getChildData($alias, 'title')) ?></span></dt>
  206. <dd class="tab-container">
  207. <div class="tab-content"><?php echo $html ?></div>
  208. </dd>
  209. <?php endforeach;?>
  210. </dl>
  211. <?php endif; ?>
  212. </div>
  213.  
  214. <?php echo $this->getChildHtml('upsell_products');
  215. echo $this->getChildHtml('product_additional_data')
  216. ?>
  217.  
  218. </div>
  219. <!-- tabs -->
  220.  
  221. <div id="tab-container">
  222. <div class="tabs active" onclick="changeTab(0)"><?php echo $this->__('Product Description');?></div>
  223. <div class="tabs" onclick="changeTab(1)"><?php echo $this->__('Features');?></div>
  224. <div class="tabs" onclick="changeTab(2)"><?php echo $this->__('Packaging');?></div>
  225. <div class="tabs" onclick="changeTab(3)"><?php echo $this->__('Reviews');?></div>
  226. <div class="tabs" onclick="changeTab(4)"><?php echo $this->__('Add Reviews');?></div>
  227.  
  228. <div id="tab-1" class="tab-text active">
  229. <div class="next-content-product">
  230.  
  231. <h3><?php echo $this->__("Product Description of "); ?><span><?php echo $this->getProduct()->getName(); ?></span></h3>
  232. <?php echo $_product->getDescription();?>
  233.  
  234.  
  235.  
  236. </div>
  237. </div>
  238. <div id="tab-2" class="tab-text">
  239. <div class="next-level-content-product">
  240.  
  241. <div class="size-space">
  242. <h3><?php echo $this->__("Features of "); ?><span><?php echo $this->getProduct()->getName(); ?></span></h3>
  243. <?php echo $attribute_value = $_product->getData('size_space');?>
  244.  
  245.  
  246. </div>
  247. </div>
  248. </div>
  249.  
  250. <div id="tab-5" class="tab-text">
  251. <div class="interior-exterior">
  252.  
  253. <?php echo $attribute_value = $_product->getData('interior_exterior');?>
  254. </div>
  255. </div>
  256.  
  257.  
  258. <div id="tab-3" class="tab-text">
  259.  
  260.  
  261. <?php
  262. $reviewListBlock = $this->getLayout()->createBlock('review/product_view_list');
  263. echo $reviewListBlock->setTemplate('review/product/view/list.phtml')->toHtml();
  264. ?>
  265. </div>
  266.  
  267. <div id="tab-4" class="tab-text">
  268.  
  269. <?php
  270. $reviewFormBlock = $this->getLayout()->createBlock('review/form');
  271. echo $reviewFormBlock->setTemplate('review/form.phtml')->toHtml();
  272. ?>
  273.  
  274. </div>
  275.  
  276. <div id="tab-5" class="tab-text">
  277. <div class="interior-exterior">
  278.  
  279. <?php echo $attribute_value = $_product->getData('interior_exterior');?>
  280. </div>
  281. </div>
  282.  
  283.  
  284. </div>
  285.  
  286.  
  287.  
  288. <!-- Tabs end -->
  289.  
  290.  
  291.  
  292.  
  293. <script>
  294. window.changeTab = function(tabNum){
  295. tablinks = document.getElementsByClassName("tabs");
  296. for(i = 0; i < tablinks.length; i++){
  297. tablinks[i].className = tablinks[i].className.replace(" active","");
  298. if(i == tabNum){
  299. tablinks[i].className += " active";
  300. }
  301. }
  302. tabs = document.getElementsByClassName("tab-text");
  303. for(i = 0; i < tabs.length; i++){
  304. tabs[i].className = tabs[i].className.replace(" active","");
  305. if(i == tabNum){
  306. tabs[i].className += " active";
  307. }
  308. }
  309. }
  310.  
  311. SrkaReviewStars = Class.create();
  312. SrkaReviewStars.prototype = {
  313. initialize: function(reviewTableId){
  314. var _this = this;
  315. _this.ratingTable = $(reviewTableId);
  316. _this.ratings = {};
  317. _this.html = '';
  318.  
  319. this.ratingTable.hide();
  320. this.ratingTable.select('tbody > tr').each(function(row, row_count){
  321. var ratingCode = row.select('.radio')[0].readAttribute('name');
  322. var ratingLabel = row.select('th')[0].innerHTML;
  323. var ratingOptions = [];
  324. row.select('.radio').each(function(radio){
  325. ratingOptions.push(radio.value);
  326. });
  327.  
  328. _this.ratings[ratingCode] = {
  329. code: ratingCode,
  330. label: ratingLabel,
  331. options: ratingOptions
  332. };
  333. });
  334.  
  335. _this.html += '<div id="srka-product-review-list" class="input-box">';
  336. for(var i in _this.ratings){
  337. var code_id = _this.ratings[i]['code'].replace(/[\[]/g, '_').replace(/[\]]/g, '');
  338. _this.html += '<div id="code-' + code_id + '" class="srka-rating-code">\n';
  339. _this.html += ' <div class="label">' + _this.ratings[i]['label'] + '</div>\n';
  340. _this.html += ' <ul class="options">\n';
  341.  
  342. for(var j = 0; j < _this.ratings[i]['options'].length; j++){
  343. var option_id = 'srka-' + _this.ratings[i]['label'] + '_' + _this.ratings[i]['options'][j];
  344. _this.html += ' <li><a href="#" id="' + option_id + '" class="option" onclick="reviewStars.select(\'' + _this.ratings[i]['code'] + '\', ' + _this.ratings[i]['options'][j] + '); return false;"></a></li>\n';
  345. }
  346.  
  347. _this.html += ' </ul>\n';
  348. _this.html += ' <div style="clear: both;"></div>\n';
  349. _this.html += '</div>\n';
  350. }
  351. _this.html += '</div>';
  352.  
  353. //console.log(_this.ratings);
  354. //console.log(_this.html);
  355. this.ratingTable.insert({
  356. after: _this.html
  357. });
  358. },
  359.  
  360. select: function(ratingCode, ratingOption){
  361. var options = this.ratings[ratingCode]['options'];
  362.  
  363. this.ratingTable.select('.radio[value="' + ratingOption + '"]')[0].checked = true;
  364.  
  365. for(var i = 0; i < options.length; i++){
  366. var srka_option_id = 'srka-' + this.ratings[ratingCode]['label'] + '_' + this.ratings[ratingCode]['options'][i];
  367. var option_id = srka_option_id.replace('srka-', '');
  368. if(options[i] <= ratingOption){
  369. $(srka_option_id).addClassName('selected');
  370. }else{
  371. $(srka_option_id).removeClassName('selected');
  372. }
  373. }
  374. }
  375.  
  376. }
  377.  
  378.  
  379.  
  380.  
  381. </script>
  382.  
  383. <script type="text/javascript">
  384.  
  385. function setrequestlogin()
  386. {
  387. //jQuery("#productlistlogin").trigger("click");
  388. }
  389.  
  390. </script>
  391.  
  392. <style>
  393. .product-view .product-shop .product-name {
  394. width: 100%;
  395. }
  396. .dinfo {
  397. padding-top: 0px;float:left;
  398. }
  399. .zoom-notice,label.required::after, span.required::after,.product-options p.required {
  400. display:none;
  401. }
  402. .product-options-bottom { position :relative; bottom:10px !important;padding:15px 0; }
  403. .product-view .product-shop {
  404. float: left;
  405. width: 50%;
  406. }
  407. .wishlist img { display : none;}
  408.  
  409. .usually { display : none; }
  410.  
  411. .product-essential { position: relative !important; }
  412.  
  413. <!-- remove black background after click on "save design" -->
  414.  
  415. #ajaxlogin-mask { display : none }
  416.  
  417. <!-- remove black background after click on "save design" -->
  418.  
  419. </style>
Add Comment
Please, Sign In to add comment