Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.83 KB | None | 0 0
  1. <?php
  2. /***************************************
  3. *** Cash On Delivery ***
  4. ***************************************
  5. *
  6. */
  7.  
  8. $msgData = Mage::helper('netgo_cod')->getConfigData();
  9. if($msgData['zip_status'] == 1){
  10. ?>
  11. <div class="input-box">
  12. <div class="z-btn">
  13. <label>Zip Code : </label><input type="text" placeholder="Enter your pincode" value="" name="cod" class="product-custom-option required-entry" id="cod" size="29" style='color:black; font-size:12px'>
  14. <button type="button" onclick="checkCOD();" name="zip-check" title="Check" class="button" id="zip-check"><span><span>Check</span></span></button>
  15. </div>
  16. <div id="cod_msg"></div>
  17. </div>
  18.  
  19. <script>
  20. function checkCOD(){
  21. var zipcode;
  22. var cod = $('cod').value;
  23. if(cod == ''){
  24. $('cod_msg').update('<span class="cod-error"><?php echo $msgData['emp_msg']; ?></span>');
  25. return
  26. }else{
  27. $('cod_msg').update('<img src="<?php echo Mage::getBaseUrl( Mage_Core_Model_Store::URL_TYPE_WEB, true ).'media/cod/img/ajax-loader-2.gif';?>">');
  28. new Ajax.Request('<?php echo Mage::getBaseUrl().'netgo/cod/check';?>', {
  29. method:'post',
  30. parameters: {zipcode: cod},
  31. onSuccess: function(transport) {
  32. var response = transport.responseText || "no response text";
  33. $('cod_msg').update(response);
  34.  
  35. if(response.search('Delivery of the book is not available on the above pincode')!=-1)
  36. {
  37. zipcode='checked';
  38. }
  39. else
  40. {
  41. zipcode='';
  42. }
  43.  
  44. },
  45. onFailure: function() { alert('Something went wrong...'); }
  46. });
  47. }
  48. }
  49. </script>
  50. <?php } ?>
  51.  
  52. <?php
  53. /**
  54. */
  55. ?>
  56. <?php $_helper = $this->helper('catalog/output'); ?>
  57. <?php $_product = $this->getProduct(); ?>
  58. <script type="text/javascript">
  59. var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
  60. </script>
  61. <div id="messages_product_view"><?php echo $this->getMessagesBlock()->toHtml() ?></div>
  62. <div class="product-view">
  63. <div class="product-essential">
  64. <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; ?>>
  65. <?php echo $this->getBlockHtml('formkey') ?>
  66. <div class="no-display">
  67. <input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
  68. <input type="hidden" name="related_product" id="related-products-field" value="" />
  69. </div>
  70.  
  71. <div class="product-img-box">
  72. <div class="product-name">
  73. <h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
  74. </div>
  75. <?php echo $this->getChildHtml('media') ?>
  76. </div>
  77.  
  78. <div class="product-shop">
  79. <div class="product-name">
  80. <span class="h1"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></span>
  81. </div>
  82.  
  83. <div class="price-info">
  84. <?php echo $this->getPriceHtml($_product); ?>
  85. <?php echo $this->getChildHtml('bundle_prices') ?>
  86. <?php echo $this->getTierPriceHtml() ?>
  87. </div>
  88.  
  89. <div class="extra-info">
  90. <?php echo $this->getReviewsSummaryHtml($_product, 'default', false)?>
  91. <?php echo $this->getChildHtml('product_type_availability'); ?>
  92. </div>
  93.  
  94. <?php echo $this->getChildHtml('alert_urls') ?>
  95.  
  96. <?php if ($_product->getShortDescription()):?>
  97. <div class="short-description">
  98. <div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
  99. </div>
  100. <?php endif;?>
  101.  
  102.  
  103.  
  104.  
  105. <?php echo $this->getChildHtml('other');?>
  106.  
  107. <?php if ($_product->isSaleable() && $this->hasOptions()):?>
  108. <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
  109. <?php endif;?>
  110.  
  111. </div>
  112.  
  113. <div class="add-to-cart-wrapper">
  114. <?php echo $this->getChildHtml('product_type_data') ?>
  115. <?php echo $this->getChildHtml('extrahint') ?>
  116.  
  117. <?php if (!$this->hasOptions()):?>
  118. <div class="add-to-box">
  119. <?php if($_product->isSaleable()): ?>
  120. <?php echo $this->getChildHtml('addtocart') ?>
  121. <?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
  122. <span class="or"><?php echo $this->__('OR') ?></span>
  123. <?php endif; ?>
  124. <?php endif; ?>
  125. <?php echo $this->getChildHtml('addto') ?>
  126. <?php echo $this->getChildHtml('sharing') ?>
  127. </div>
  128. <?php echo $this->getChildHtml('extra_buttons') ?>
  129. <?php elseif (!$_product->isSaleable()): ?>
  130. <div class="add-to-box">
  131. <?php echo $this->getChildHtml('addto') ?>
  132. <?php echo $this->getChildHtml('sharing') ?>
  133. </div>
  134. <?php endif; ?>
  135. </div>
  136.  
  137. <?php echo $this->getChildHtml('related_products') ?>
  138.  
  139. <div class="clearer"></div>
  140. <?php if ($_product->isSaleable() && $this->hasOptions()):?>
  141. <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
  142. <?php endif;?>
  143. </form>
  144. <script type="text/javascript">
  145. //<![CDATA[
  146. var productAddToCartForm = new VarienForm('product_addtocart_form');
  147. productAddToCartForm.submit = function(button, url) {
  148. if (this.validator.validate()) {
  149. var form = this.form;
  150. var oldUrl = form.action;
  151.  
  152. if (url) {
  153. form.action = url;
  154. }
  155. var e = null;
  156. try {
  157.  
  158. this.form.submit();
  159.  
  160. } catch (e) {
  161. }
  162. this.form.action = oldUrl;
  163. if (e) {
  164. throw e;
  165. }
  166.  
  167. if (button && button != 'undefined') {
  168. button.disabled = true;
  169. }
  170. }
  171. }.bind(productAddToCartForm);
  172.  
  173. productAddToCartForm.submitLight = function(button, url){
  174. if(this.validator) {
  175. var nv = Validation.methods;
  176. delete Validation.methods['required-entry'];
  177. delete Validation.methods['validate-one-required'];
  178. delete Validation.methods['validate-one-required-by-name'];
  179. // Remove custom datetime validators
  180. for (var methodName in Validation.methods) {
  181. if (methodName.match(/^validate-datetime-.*/i)) {
  182. delete Validation.methods[methodName];
  183. }
  184. }
  185.  
  186. if (this.validator.validate()) {
  187. if (url) {
  188. this.form.action = url;
  189. }
  190. this.form.submit();
  191. }
  192. Object.extend(Validation.methods, nv);
  193. }
  194. }.bind(productAddToCartForm);
  195. //]]>
  196. </script>
  197. </div>
  198.  
  199. <div class="product-collateral toggle-content tabs">
  200. <?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>
  201. <dl id="collateral-tabs" class="collateral-tabs">
  202. <?php foreach ($detailedInfoGroup as $alias => $html):?>
  203. <dt class="tab"><span><?php echo $this->escapeHtml($this->getChildData($alias, 'title')) ?></span></dt>
  204. <dd class="tab-container">
  205. <div class="tab-content"><?php echo $html ?></div>
  206. </dd>
  207. <?php endforeach;?>
  208. </dl>
  209. <?php endif; ?>
  210. </div>
  211.  
  212. <?php echo $this->getChildHtml('upsell_products') ?>
  213. <?php echo $this->getChildHtml('product_additional_data') ?>
  214.  
  215. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement