Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.34 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@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 base_default
  23. * @copyright Copyright (c) 2006-2014 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. <script type="text/javascript" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'itoris/productqa/productqa.js'; ?>"></script>
  35. <?php
  36. $_helper = $this->helper('catalog/output');
  37. $_product = $this->getProduct();
  38. $currentProductId=$_product->getId();
  39. $_qxdHelper = $this->helper('qxd_updateprice');
  40.  
  41. $_memcached = Mage::helper('memcached')->initMemcached();
  42. $_memcachedKeys = $_memcached->getMulti(array($currentProductId.'_media',$currentProductId.'_reviewSummary',$currentProductId.'_description',$currentProductId.'_attributes',$currentProductId.'_scrollOptions'));
  43.  
  44. //$inventoryService = Mage::getSingleton('advancedinventory/service_inventory');
  45. //$jsonConfig = $inventoryService->getAssociatedData();
  46. ?>
  47. <script type="text/javascript">
  48. var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
  49. /*google trusted store*/
  50. gts.push(["google_base_offer_id", "<?php echo $_product->getSku()?>"]);
  51. </script>
  52. <div id="messages_product_view"><?php echo $this->getMessagesBlock()->toHtml() ?></div>
  53. <div class="product-view">
  54. <div class="product-essential">
  55. <form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post"
  56. id="product_addtocart_form"<?php if ($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
  57. <?php echo $this->getBlockHtml('formkey') ?>
  58. <div class="no-display">
  59. <input type="hidden" name="product" value="<?php echo $currentProductId ?>"/>
  60. <input type="hidden" name="related_product" id="related-products-field" value=""/>
  61. </div>
  62.  
  63. <div class="row">
  64.  
  65. <div class="product-img-box col-sm-6">
  66. <?php if($_memcachedKeys[$currentProductId.'_media']){ echo $_memcachedKeys[$currentProductId.'_media']; }
  67. else{
  68. echo $this->getChildHtml('media');
  69. $_memcached->set($currentProductId.'_media',$this->getChildHtml('media'));
  70. } ?>
  71. </div> <!-- /.product-img-box -->
  72. <div class="product-shop col-sm-6">
  73. <div class="product-name">
  74. <h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
  75. </div>
  76. <?php if($_memcachedKeys[$currentProductId.'_reviewSummary']){ echo $_memcachedKeys[$currentProductId.'_reviewSummary']; } ?>
  77. <?php /*if ($_product->getShortDescription()):*/ ?><!--
  78. <div class="short-description">
  79. <div class="std"><?php /*echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') */ ?></div>
  80. </div>
  81. --><?php /*endif;*/ ?>
  82.  
  83. <?php //echo $this->getReviewsSummaryHtml($_product, false, true)?>
  84.  
  85. <?php echo $this->getChildHtml('alert_urls') ?>
  86.  
  87.  
  88.  
  89. <!-- OPEN PRODUCT INFO BLOCK -->
  90. <div class="product-info <?php echo $_product->getTypeID(); ?>-block">
  91. <?php //Mage::log($this->getChildHtml('product_type_data'), null, 'view.log') jose;?>
  92. <?php //echo $this->getChildHtml('product_type_data') ?>
  93.  
  94. <!-- OPEN GET TIER PRICE -->
  95. <?php echo $this->getTierPriceHtml() ?>
  96. <!-- CLOSE GET TIER PRICE -->
  97.  
  98. <?php if (!$this->hasOptions()) { ?>
  99.  
  100. <!-- OPEN ADD TO BOX 1 -->
  101. <div class="add-to-box">
  102.  
  103. <!-- OPEN ADD TO CART 1 -->
  104. <?php echo $this->getChildHtml('addtocart') ?>
  105. <!-- CLOSE ADD TO CART 1 -->
  106.  
  107. <!-- OPEN ADD TO 2 -->
  108. <?php echo $this->getChildHtml('addto') ?>
  109. <!-- CLOSE ADD TO 2 -->
  110. </div>
  111. <!-- CLOSE ADD TO BOX -->
  112.  
  113. <!-- OPEN EXTRA BUTTONS -->
  114. <?php echo $this->getChildHtml('extra_buttons') ?>
  115. <!-- CLOSE EXTRA BUTTONS -->
  116. <?php } else { ?>
  117. <!-- OPEN ADD-TO-BOX -->
  118. <div class="add-to-box">
  119. <!-- OPEN ADD-TO- 2 -->
  120. <?php echo $this->getChildHtml('addto') ?>
  121. <!-- CLOSE ADD-TO- 2 -->
  122. </div>
  123. <!-- CLOSE ADD-TO-BOX -->
  124. <?php } ?>
  125.  
  126. <?php /*WDCA CODE BEGIN*/ ?>
  127. <?php /*echo $this->getChildHtml('rewardsReview'); */ ?>
  128.  
  129. <?php /*echo $this->getChildHtml('points'); */ ?>
  130.  
  131.  
  132. <?php /*WDCA CODE END*/ ?>
  133.  
  134. <?php echo $this->getChildHtml('other'); ?>
  135.  
  136.  
  137. <?php if (/*$_product->isSaleable() &&*/
  138. $this->hasOptions()
  139. ): ?>
  140. <!-- OPEN CONTAINER 1 -->
  141. <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
  142. <!-- CLOSE CONTAINER 1 -->
  143.  
  144. <!-- OPEN ADD TO 3 -->
  145. <?php echo $this->getChildHtml('addto') ?>
  146. <!-- CLOSE ADD TO 3 -->
  147.  
  148. <?php endif; ?>
  149.  
  150. </div>
  151.  
  152. <!-- CLOSE PRODUCT INFO BLOCK -->
  153.  
  154. <?php //echo $this->getChildHtml('social.links')?>
  155.  
  156. <?php echo $this->getChildHtml('extrahint') ?>
  157.  
  158.  
  159. <?php /*WDCA CODE BEGINS*/ ?>
  160. <?php /*echo $this->getChildHtml('points'); */ ?>
  161. <?php /*WDCA CODE ENDS*/ ?>
  162.  
  163.  
  164.  
  165.  
  166. <?php if (/*$_product->isSaleable() &&*/
  167. $this->hasOptions()
  168. ): ?>
  169. <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
  170. <?php endif; ?>
  171.  
  172. </div> <!-- /.product-shop -->
  173.  
  174. </div> <!-- /.row -->
  175.  
  176.  
  177. </form>
  178. <script type="text/javascript">
  179. //<![CDATA[
  180. var productAddToCartForm = new VarienForm('product_addtocart_form');
  181. productAddToCartForm.submit = function (button, url) {
  182. if (this.validator.validate()) {
  183. var form = this.form;
  184. var oldUrl = form.action;
  185.  
  186. if (url) {
  187. form.action = url;
  188. }
  189. var e = null;
  190. try {
  191. this.form.submit();
  192. } catch (e) {
  193. }
  194. this.form.action = oldUrl;
  195. if (e) {
  196. throw e;
  197. }
  198.  
  199. if (button && button != 'undefined') {
  200. button.disabled = true;
  201. }
  202. }
  203. }.bind(productAddToCartForm);
  204.  
  205. productAddToCartForm.submitLight = function (button, url) {
  206. if (this.validator) {
  207. var nv = Validation.methods;
  208. delete Validation.methods['required-entry'];
  209. delete Validation.methods['validate-one-required'];
  210. delete Validation.methods['validate-one-required-by-name'];
  211. // Remove custom datetime validators
  212. for (var methodName in Validation.methods) {
  213. if (methodName.match(/^validate-datetime-.*/i)) {
  214. delete Validation.methods[methodName];
  215. }
  216. }
  217.  
  218. if (this.validator.validate()) {
  219. if (url) {
  220. this.form.action = url;
  221. }
  222. this.form.submit();
  223. }
  224. Object.extend(Validation.methods, nv);
  225. }
  226. }.bind(productAddToCartForm);
  227. //]]>
  228. </script>
  229. </div>
  230. <div class="product-collateral">
  231. <?php //echo $this->getChildHtml('relatedProducts');?>
  232.  
  233. <!--remove role (tabs) - tab content functionality -->
  234. <ul class="nav nav-tabs"> <!--role="tablist"-->
  235. <li> <!--role="presentation"-->
  236. <a href="#description"> <!--role="tab" data-toggle="tab"-->
  237. <?php echo $this->__('Product Overview') ?>
  238. </a>
  239. </li>
  240. <li> <!--role="presentation"-->
  241. <a href="#details"><!--href="" role="tab" data-toggle="tab" -->
  242. <?php echo $this->__('Specifications') ?>
  243. </a>
  244. </li>
  245. <?php /* new tabs - update template and functionality */ ?>
  246. <li> <!--role="presentation"-->
  247. <a href="#customer_qa"><!--href="" role="tab" data-toggle="tab" -->
  248. <?php echo $this->__('Customer Questions') ?>
  249. </a>
  250. </li>
  251. <li>
  252. <a href="#customer_reviews"> <!--role="tab" data-toggle="tab"-->
  253. <?php echo $this->__('Customer Reviews') ?>
  254. </a>
  255. </li>
  256.  
  257. <!--role="tab" data-toggle="tab"-->
  258. <!-- <li>
  259. <a href="#recommended">
  260. < ?php echo $this->__('Recommended items') ?>
  261. </a>
  262. </li> -->
  263.  
  264. </ul>
  265. <!--remove tab content functionality-->
  266. <div class="tab-content content-product">
  267. <div id="description" class="wrapper-info"> <!-- role="tabpanel" class="tab-pane active"-->
  268. <div class="block-title">
  269. <p><?php echo $this->__('Product Overview') ?></p>
  270. </div>
  271. <div class="description-data">
  272. <?php if($_memcachedKeys[$currentProductId.'_description']){ echo $_memcachedKeys[$currentProductId.'_description']; } ?>
  273. </div>
  274. </div>
  275.  
  276. <div id="details" class="wrapper-info"> <!-- role="tabpanel" class="tab-pane" id="details" -->
  277. <div class="block-title specifications">
  278. <p><?php echo $this->__('Specifications') ?></p>
  279. <?php if($_memcachedKeys[$currentProductId.'_attributes']){ echo $_memcachedKeys[$currentProductId.'_attributes']; } ?>
  280. </div>
  281. </div>
  282. <div id="customer_qa" class="wrapper-info">
  283. <div class="block-title customer_qa">
  284. <p><?php echo $this->__('Customer Questions') ?></p>
  285. </div>
  286. <?php //echo $this->getChildHtml('itoris_qa') ?>
  287. <img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); ?>frontend/divers/default/images/opc-ajax-loader.gif"
  288. alt="Loading next step..." title="Loading next step" class="v-middle" id="QALoading"
  289. style="float:left; margin: auto; display: none">
  290. </div>
  291. <div id="customer_reviews" class="wrapper-info"> <!--role="tabpanel" class="tab-pane" -->
  292. <div class="block-title review">
  293. <p><?php echo $this->__('Customer Reviews') ?></p>
  294. </div>
  295.  
  296. <?php //echo $this->getChildHtml('product_review') ?>
  297. </div>
  298.  
  299.  
  300. </div>
  301. <br>
  302. <?php //echo $this->getChildHtml('awautorelated2')?>
  303. <?php //echo $this->getChildHtml('upsell_products') ?>
  304. <?php echo $this->getChildHtml('product_additional_data') ?>
  305. </div>
  306. </div>
  307. <?php if($_memcachedKeys[$currentProductId.'_scrollOptions']){ echo $_memcachedKeys[$currentProductId.'_scrollOptions']; } ?>
  308. <!-- set page position according with the tabs options -->
  309.  
  310.  
  311. <script type="text/javascript">
  312.  
  313. if (jQuery('.product-info.simple-block').find('.regular-price.5').length != 0) {
  314. jQuery('.product-info.simple-block .price-box').addClass('block-regular-price');
  315. }
  316. if (jQuery('.product-info.simple-block .block-regular-price + .add-to-box').find('div').length == 0) {
  317. jQuery('.product-info.simple-block .block-regular-price + .add-to-box').addClass('empty-block');
  318. jQuery('.product-info.simple-block .block-regular-price').addClass('empty-box');
  319. }
  320.  
  321. var selectOptionPrices =<?php echo $_qxdHelper->getPrices($_product); ?>;
  322. var defaultPrice = true;
  323. var valueDefaultPrice = "";
  324. var spinner_path = '<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif');?>';
  325. <?php if(!$_memcachedKeys[$currentProductId.'_description']){ ?> jQuery(".description-data").append('<div class="description-spinner"><img src=' + spinner_path + ' alt="" /></div>'); <?php } ?>
  326.  
  327. jQuery(document).ready(function () {
  328. jQuery(function () {
  329. jQuery('a[href*="#"]:not([href="#"])').click(function () {
  330. if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
  331. var target = jQuery(this.hash);
  332. target = target.length ? target : jQuery('[name=' + this.hash.slice(1) + ']');
  333. if (target.length) {
  334. jQuery('html, body').animate({
  335. scrollTop: target.offset().top
  336. }, 1000);
  337. return false;
  338. }
  339. }
  340. });
  341. });
  342. jQuery("#attribute162").change(function () {
  343. if (defaultPrice) {
  344. if (jQuery(".product-shop .regular-price").first()) {
  345. valueDefaultPrice = jQuery(".regular-price").first().html();
  346. }
  347. if (jQuery(".product-shop .special-price .price").first().length > 0) {
  348. valueDefaultPrice = jQuery(".special-price .price").first().text();
  349. }
  350. defaultPrice = false;
  351. }
  352.  
  353. if (!jQuery('#attribute164').length) {
  354. var simpleProductID = jQuery("#attribute162 option:selected").val();
  355.  
  356. jQuery.each(selectOptionPrices, function (i, val) {
  357. if (simpleProductID == val.color_id) {
  358. if (jQuery(".product-shop .regular-price").first()) {
  359. jQuery(".product-shop .regular-price").html('<span class="price" >$' + parseFloat(val.price).toFixed(2) + '</span>');
  360. }
  361. if (jQuery(".product-shop .special-price .price").first().length > 0) {
  362. jQuery(".product-shop .special-price .price").text('$' + parseFloat(val.price).toFixed(2));
  363. }
  364. }
  365. });
  366.  
  367. if (simpleProductID == "") {
  368. if (jQuery(".product-shop .regular-price").first()) {
  369. jQuery(".product-shop .regular-price").html(valueDefaultPrice);
  370. }
  371. if (jQuery(".product-shop .special-price .price").first().length > 0) {
  372. jQuery(".product-shop .special-price .price").text(valueDefaultPrice);
  373. }
  374. }
  375. } else {
  376. //console.log(valueDefaultPrice);
  377. if (jQuery(".product-shop .regular-price").first()) {
  378. jQuery(".product-shop .regular-price").html(valueDefaultPrice);
  379. }
  380. if (jQuery(".product-shop .special-price .price").first().length > 0) {
  381. jQuery(".product-shop .special-price .price").text(valueDefaultPrice);
  382. }
  383. }
  384. });
  385. jQuery("#attribute164").change(function () {
  386. if (defaultPrice) {
  387. if (jQuery(".product-shop .regular-price").first()) {
  388. valueDefaultPrice = jQuery(".product-shop .regular-price").first().html();
  389. }
  390. if (jQuery(".product-shop .special-price .price").first().length > 0) {
  391. valueDefaultPrice = jQuery(".product-shop .special-price .price").first().text();
  392. }
  393.  
  394. defaultPrice = false;
  395. }
  396. var simpleProductID = jQuery("#attribute164 option:selected").val();
  397.  
  398. if (jQuery('#attribute162').length) {
  399. var currentColorID = jQuery("#attribute162 option:selected").val();
  400. }
  401. jQuery.each(selectOptionPrices, function (i, val) {
  402. if (!jQuery('#attribute162').length) {
  403. if (simpleProductID == val.size_id) {
  404. if (jQuery(".product-shop .regular-price").first()) {
  405. jQuery(".product-shop .regular-price").html('<span class="price" >$' + parseFloat(val.price).toFixed(2) + '</span>');
  406. }
  407. if (jQuery(".product-shop .special-price .price").first().length > 0) {
  408. jQuery(".product-shop .special-price .price").text('$' + parseFloat(val.price).toFixed(2));
  409. }
  410. }
  411. } else {
  412. if (simpleProductID == val.size_id && currentColorID == val.color_id) {
  413. if (jQuery(".product-shop .regular-price").first()) {
  414. jQuery(".product-shop .regular-price").html('<span class="price" >$' + parseFloat(val.price).toFixed(2) + '</span>');
  415. }
  416. if (jQuery(".product-shop .special-price .price").first().length > 0) {
  417. jQuery(".product-shop .special-price .price").text('$' + parseFloat(val.price).toFixed(2));
  418. }
  419. }
  420. }
  421. });
  422.  
  423. if (simpleProductID == "") {
  424. if (jQuery(".product-shop .regular-price").first()) {
  425. jQuery(".product-shop .regular-price").html(valueDefaultPrice);
  426. }
  427. if (jQuery(".product-shop .special-price .price").first().length > 0) {
  428. jQuery(".product-shop .special-price .price").text(valueDefaultPrice);
  429. }
  430. }
  431. });
  432.  
  433. function loadReviewSummary()
  434. {
  435. new Ajax.Request("<?php echo $this->getUrl('productview/ajax/reviewSummary') ?>", {
  436. method: 'Post',
  437. parameters: {"productid":<?php echo $currentProductId?>},
  438. onComplete: function (transport) {
  439. jQuery(transport.responseJSON).insertAfter(".product-name");
  440. }
  441. });
  442. }
  443. function loadAttributes()
  444. {
  445. new Ajax.Request("<?php echo $this->getUrl('productview/ajax/attributes') ?>", {
  446. method: 'Post',
  447. parameters: {"productid":<?php echo $currentProductId?>},
  448. onComplete: function (transport) {
  449. jQuery(".bt-specifications-spinner").remove();
  450. jQuery(transport.responseText).insertAfter(".block-title.specifications");
  451. }
  452. });
  453. }
  454. function loadReviews()
  455. {
  456. new Ajax.Request("<?php echo $this->getUrl('productview/ajax/reviews') ?>", {
  457. method: 'Post',
  458. parameters: {"productid":<?php echo $currentProductId?>},
  459. onComplete: function (transport) {
  460. jQuery(".bt-review-spinner").remove();
  461. jQuery(transport.responseText).insertAfter(".block-title.review");
  462. new Ajax.Request("<?php echo $this->getUrl('productview/ajax/reviewform') ?>", {
  463. method: 'Post',
  464. parameters: {"id":<?php echo $currentProductId?>},
  465. onComplete: function (transport) {
  466. if (jQuery(".box-collateral.box-reviews dl").length)
  467. jQuery(transport.responseText).insertAfter(".box-collateral.box-reviews dl");
  468. else
  469. jQuery(transport.responseText).appendTo(".box-collateral.box-reviews");
  470. }
  471. });
  472. }
  473. });
  474. }
  475. function loadRelatedProducts()
  476. {
  477. new Ajax.Request("<?php echo $this->getUrl('productview/ajax/relatedproducts') ?>", {
  478. method: 'Post',
  479. parameters: {"id":<?php echo $currentProductId?>},
  480. onComplete: function (transport) {
  481. jQuery(transport.responseText).insertAfter(".tab-content.content-product");
  482. }
  483. });
  484. }
  485. function loadDescription()
  486. {
  487. new Ajax.Request("<?php echo $this->getUrl('productview/ajax/description') ?>", {
  488. method: 'Post',
  489. parameters: {"id":<?php echo $currentProductId?>},
  490. onComplete: function (transport) {
  491. jQuery(".description-data").html(transport.responseText);
  492. }
  493. });
  494. }
  495.  
  496. var price = <?php echo Mage::getBlockSingleton('qxd_productview/view')->getPriceBlock($_product);?>;
  497. jQuery(price).prependTo(".product-info");
  498.  
  499. function loadScrollOptions()
  500. {
  501. new Ajax.Request("<?php echo $this->getUrl('productview/ajax/scrolloptions') ?>", {
  502. method: 'Post',
  503. parameters: {"id":<?php echo $currentProductId?>},
  504. onComplete: function (transport) {
  505. jQuery(transport.responseText).insertAfter(".product-view");
  506. }
  507. });
  508. }
  509. function loadQABlock() {
  510. jQuery.ajax({
  511. url: "<?php echo $this->getUrl('extendqa/index/returnBlockCode');?>",
  512. beforeSend: function () {
  513. jQuery("#QALoading").css('display', 'block');
  514. },
  515. data: {product_id: '<?php echo $currentProductId; ?>'},
  516. complete: function(){
  517. loadBeforeAuthUrl();
  518. },
  519. success: function (result_qa) {
  520. jQuery("#QALoading").css('display', 'none');
  521. if (result_qa != "") {
  522. //jQuery("#rewardPLoading").css('display','none');
  523. jQuery("#customer_qa").append(result_qa);
  524. }
  525. else {
  526. jQuery("#QALoading").css('display', 'none');
  527. }
  528. }
  529. });
  530. }
  531. function loadBeforeAuthUrl(){
  532. jQuery.ajax({
  533. url : '<?php echo Mage::getBaseUrl() ?>extendqa/index/reloadBeforeAuthUrl',
  534. data: {url: '<?php echo Mage::helper("core/url")->getCurrentUrl().'#review_form_block' ?>' },
  535. success : function(response){},
  536. error: function(e){}
  537. });
  538. }
  539.  
  540. function check_() {
  541. var distance = jQuery('#description').offset().top;
  542. if (jQuery(window).scrollTop() >= distance)
  543. {
  544. jQuery('#options-panel').slideDown('fast');
  545.  
  546. if (jQuery('.price-as-configured').length != 0)
  547. {
  548. if (jQuery('.product-info.bundle-block .price-from').length != 0 && jQuery('.product-info.bundle-block .price-to').length != 0)
  549. {
  550. jQuery('.block-summary .price').html(
  551. jQuery('.product-info.bundle-block .price-box-bundle .price-from .price').text()
  552. + ' - ' +
  553. jQuery('.product-info.bundle-block .price-box-bundle .price-to .price').text()
  554. );
  555. } else { jQuery('.block-summary .price').html(jQuery('.wrapper-options .price-as-configured .price').text()); }
  556. }
  557.  
  558. if (jQuery('.product-info.simple-block').length != 0)
  559. {
  560. if (jQuery('.product-info.simple-block .old-price').length != 0)
  561. {
  562. jQuery('.block-summary .price').html('<span class="scrollOldPrice">'+jQuery('.price-box .old-price .price').text()+'</span>'+" "+jQuery('.price-box .special-price .price').text() );
  563. }
  564. else { jQuery('.block-summary .price').html(jQuery('.product-info.simple-block .availability.in-stock + .price-box .price').text()); }
  565. }
  566.  
  567. if (jQuery('.product-info.configurable-block').length != 0)
  568. {
  569. if (jQuery('.product-info.configurable-block .old-price').length != 0)
  570. {
  571. jQuery('.block-summary .price').html('<span class="scrollOldPrice">'+jQuery('.product-info > .price-box .old-price .price').text()+'</span>'+" "+jQuery('.product-info > .price-box .special-price .price').text() );
  572. jQuery('#options-panel').addClass('special-block');
  573. } else { jQuery('.block-summary .price').html(jQuery('.product-info.configurable-block .availability.in-stock + .price-box').text()); }
  574.  
  575. }
  576.  
  577. if (jQuery('.product-info.giftvoucher-block').length != 0) { jQuery('.block-summary .price').html(jQuery('.product-info.giftvoucher-block .price-box .price').text()); }
  578.  
  579. if (jQuery('.availability.out-of-stock').length != 0)
  580. {
  581. jQuery('.block-button #btn-buy').html('Return to Top');
  582.  
  583.  
  584. if (jQuery('.product-info.configurable-block .old-price').length != 0)
  585. {
  586. jQuery('.block-summary .price').html('<span class="scrollOldPrice">'+jQuery('.product-info > .price-box .old-price .price').text()+'</span>'+" "+jQuery('.product-info > .price-box .special-price .price').text() );
  587. } else { jQuery('.block-summary .price').html(jQuery('.availability.out-of-stock + .price-box .price').text()); }
  588.  
  589. }
  590. }
  591. else { jQuery('#options-panel').slideUp('fast'); }
  592. }
  593.  
  594. var pri = 0;
  595. if (jQuery('.product-info').hasClass('bundle-block'))
  596. {
  597. if (jQuery('.bundle-block').find('.minimal-price').length != 0) { pri = jQuery('.bundle-block .minimal-price .price').text(); }
  598. else if (jQuery('.bundle-block').find('div.special-price').length != 0) { pri = jQuery('.bundle-block .special-price .price').text(); }
  599. else { pri = jQuery('.bundle-block .wrapper-options .price-as-configured .price').text(); }
  600. } else if (jQuery('.product-info').hasClass('simple-block'))
  601. {
  602. pri = jQuery('.simple-block .special-price').length > 0 ? jQuery('.simple-block .special-price .price').text() : jQuery('.simple-block .availability + .price-box .price').text();
  603. pri = pri.trim()
  604. } else
  605. {
  606. if (jQuery('.configurable-block').find('.special-price').length != 0)
  607. {
  608. pri = jQuery('.configurable-block .availability + .price-box .special-price .price').text();
  609.  
  610. if (pri.indexOf("-") >= 0) {
  611. pri = pri.split(' - ');
  612. pri = pri[0];
  613. }
  614. }
  615. else { pri = jQuery('.configurable-block .availability + .price-box .price').text(); }
  616. }
  617. pri = pri.replace('$', '');
  618.  
  619. if (pri < 25) { jQuery('.shipping-container').addClass('remove-shipping'); }
  620.  
  621. //call Ajax Requests
  622. <?php if(!$_memcachedKeys[$currentProductId.'_reviewSummary']){ ?>loadReviewSummary(); <?php } ?>
  623. <?php if(!$_memcachedKeys[$currentProductId.'_description']){ ?>loadDescription(); <?php } ?>
  624. <?php if(!$_memcachedKeys[$currentProductId.'_attributes']){ ?>loadAttributes(); <?php } ?>
  625. <?php if(!$_memcachedKeys[$currentProductId.'_scrollOptions']){ ?>loadScrollOptions(); <?php } ?>
  626. loadQABlock();
  627. loadReviews();
  628. // loadRelatedProducts();
  629.  
  630. check_();
  631. jQuery(window).scroll(function () { check_(); });
  632.  
  633. jQuery('#btn-buy').on('click', function (e) {
  634. e.preventDefault();
  635. jQuery('html,body').animate({
  636. scrollTop: 0
  637. }, 250);
  638. });
  639.  
  640. });//end document.ready
  641.  
  642.  
  643. /* add special safari and chrome rules */
  644. if (navigator.appVersion.indexOf("Mac") != -1) {
  645.  
  646. jQuery('select').addClass('safari');
  647. jQuery('.s-arr').addClass('arrow-safari');
  648.  
  649. if (/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())) {
  650. jQuery('select').addClass('saf-chrome');
  651. jQuery('.s-arr').addClass('saf-ch');
  652. }
  653. }
  654. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement