Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- .block-check-delivery .block-title strong {background-image:none; font-size: 11px;}
- .block-check-delivery .block-content {padding:0 10px; }
- .block-check-delivery .button {}
- .block-check-delivery input{width: 107px;}
- .button1 { background: #848484 none repeat scroll 0 0;color: white;font: 11px/1.35 Arial, Helvetica, sans-serif;border-radius: 3px;border: none;padding:11px !important;}
- .button1:hover {cursor: pointer;}
- #block_info {margin: 0 auto;width: 90%;}
- .check_delivery .block-content { border-top: 1px solid #d3d3d3; border-bottom: 1px solid #d3d3d3; padding: 10px 0; -webkit-box-shadow: inset 0 8px 10px -7px #e4e4e4; -moz-box-shadow: inset 0 8px 10px -7px #e4e4e4; box-shadow: inset 0 8px 10px -7px #e4e4e4;background-color: #f1f5f8;background: -webkit-gradient(linear,0% 0,0% 100%,from(#1a82f7),to(#fff)); background: -webkit-linear-gradient(top,#fff,#f1f5f8); background: -moz-linear-gradient(top,#fff,#f1f5f8);
- background: -ms-linear-gradient(top,#fff,#f1f5f8); background: -o-linear-gradient(top,#fff,#f1f5f8);width: 100%}
- /*.block block-list block-check-delivery { position:relative; top: 15px; font-family: Museo,Helvetica,arial,san-serif; display: inline-block;}*/
- </style>
- <div class="block-content" > <div id="block_info">
- <!-- <br/> -->
- <img src ="http://totaltoys.com/media/font-100.jpg" height= '35' width= '70'>
- <?php $blockLabel = Mage::getStoreConfig('checkdelivery/general/block_title'); ?>
- <strong><span><?php echo $this->__($blockLabel) ?></span></strong>
- <input name="zipcode" size="20" type="text" id="zipcode" maxlength="120" class="input-text" placeholder="<?php echo $this->__('Enter your PIN Code'); ?>"/>
- <button type="button" name="zip-check" title="Check" class="button1" id="zip-check" ><span><?php echo $this->__('CHECK'); ?></span></button>
- <!-- <br> --> </div>
- <div id="delivery-message"></div>
- <?php $defaultHtml = Mage::getStoreConfig('checkdelivery/general/default_html'); ?>
- <div id="delivery-html"><?php echo $defaultHtml ?></div>
- <a id="delivery-pincode-change" href="javascript:void()">change</a>
- </div>
- <script>
- Event.observe('zip-check', 'click', function(event){
- new Ajax.Request("<?php echo $this->getUrl('checkdelivery/index/index') ?>", {
- method: "get",
- parameters: {zipcode : $('zipcode').value },
- onSuccess: function(transport) {
- var json = transport.responseText.evalJSON();
- $('block_info').hide();
- $('delivery-message').update(json.message);
- $('delivery-message').setStyle({ color: json.color});
- $('delivery-html').update(json.html);
- }
- });
- });
- Event.observe('delivery-pincode-change', 'click', function(event){
- $('block_info').show();
- $('delivery-message').hide();
- $('delivery-html').hide();
- }
- });
- </script>
- First thing you have hide the delivery zipcode block. So on the AJAX success function you have to write the code to hide the `div`
- $('block_info').hide();
- before that use `<div id="delivery-html">` and `<div id="delivery-message">` outside of the `<div id="block_info">`
- Now if the customer want to change the `zipcode`
- So add the `<a>` after the `<div id="delivery-html">` and use the below script
- Event.observe('delivery-pincode-change', 'click', function(event){
- $('block_info').show();
- $('delivery-message').hide();
- $('delivery-html').hide();
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement