2016-03-29 19 views
1

tıkladığınızda nakliye belirli posta kodu için geçerli olsa da olmasa bulmak için seçenek yoktur magento site görebilirsiniz ziyaret edin: image1Gizle Metin ve görüntülü mesaj, Düğme

enter image description here

ne ben biz yazı bölümünde "110001" girin tıkladığınızda istiyorum, göstermelidir renkli "kontrol", olduğu gibi görüntü 2aşağıda:

enter image description here

demektir 1) Metin "14 satıcılarla kullanılabilir"

<?php if ($this->isFieldVisible('postcode')): ?> 
      <li class="item"> 

       <label for="search"<?php if ($this->isFieldRequired('postcode')):?> class="required" <?php endif;?>><?php if ($this->isFieldRequired('postcode')):?><em>*</em><?php endif;?><?php echo Mage::helper('webdevlopers_productpageshipping')->__('') ?></label> 
       <div class="search"> 

        <input placeholder="Enter your PIN Code" class="input-text validate-postcode<?php if ($this->isFieldRequired('postcode')):?> 
        required-entry<?php endif;?>" type="text" id="estimate_postcode" name="estimate[postcode]" 
        value="<?php echo $this->htmlEscape($this->getFieldValue('postcode')) ?>" onkeydown="if (event.keyCode == 13) { return false;}" /> 
       </div> 
      </li> 
     <?php endif; ?> 


<div class="f-right"> 
      <button type="button" title="<?php echo Mage::helper('webdevlopers_productpageshipping')->getButton(); ?>" 
      onclick="estimateProductShipping()" class="button"> 

      <span><span style ="font-size:11px; padding:5px;"> 
      <?php echo Mage::helper('webdevlopers_productpageshipping')->__('CHECK') ?></span></span> 
      </button> 
     </div> 





<script type="text/javascript"> 
var $ = jQuery.noConflict(); 
(function($) { 
$(document).ready(function(){ 
$('#estimate_postcode').keydown(function(e){ 

var items = $$(['.shipping-estimation-form input', 
'.shipping-estimation-form select', 
'#product_addtocart_form input', 
'#product_addtocart_form select']); 
var estimationUrl = '<?php echo $this->jsQuoteEscape($this->getEstimateUrl());?>'; 
var parameters = Form.serializeElements(items, true); 
console.log("zipcode onkeypress worked"); 
if (!e) e = window.event; 
var keyCode = e.keyCode || e.which; 
if (keyCode == '13'){ 
//disable default enter action 
e.preventDefault(); 
console.log("Enter button was pressed"); 
$('#shipping-estimate-loading-message').show(); 
$('#shipping-estimate-results').hide(); 

new Ajax.Updater('shipping-estimate-results', estimationUrl, { 
parameters: parameters, 
onComplete: function() { 
console.log("ajax updater worked"); 
$('#shipping-estimate-loading-message').hide(); 
$('#shipping-estimate-results').show(); 
$('#unique_id').hide(); 
//$('unique_id').hide(); 
} 
}); 
}; 
}); 
}); 
}) (jQuery); 

function estimateProductShipping() 
{ 

var estimationUrl = '<?php echo $this->jsQuoteEscape($this->getEstimateUrl());?>'; 
var items = $$(['.shipping-estimation-form input', 
'.shipping-estimation-form select', 
'#product_addtocart_form input', 
'#product_addtocart_form select']); 

var validationResult = true; 

// Check the valid input 
if (!items.map(Validation.validate).all()) { 
return; 
} 

var parameters = Form.serializeElements(items, true); 

$('shipping-estimate-loading-message').show(); 
$('shipping-estimate-results').hide(); 


new Ajax.Updater('shipping-estimate-results', estimationUrl, { 
parameters: parameters, 
onComplete: function() { 
console.log("ajax updater worked"); 
$('shipping-estimate-loading-message').hide(); 
$('shipping-estimate-results').show(); 
// $('#unique_id').hide(); 
$('unique_id').hide(); 
} 
}); 
} 

/* 

$(document).ready(function(){ 
$('check1234').on('click', function(){ 
$('#unique_id').hide(); 
$('#shipping-estimate-results').show(); 
}); 
}); 

*/ 
//]]> 
</script> 



<!-- Raph --> 

<?php if ($this->htmlEscape($this->getFieldValue('postcode'))): ?> 
<script type="text/javascript"> 
Event.observe(window, 'load', function() { 
estimateProductShipping(); 
}); 
</script> 
<?php endif; ?> 
+0

tam kodlarını yapıştırarak önlemek için deneyin, kod uzunluğu olacak küçük. Anlamak kolay olacak – Talhiner

+0

@Talhiner Yorumlarınız için teşekkür ederiz. Tam kod gönderirsek, kullanıcılar için daha kolay olacağını düşündüm. Bir dahaki sefere olabildiğince kaçınmaya çalışacağım. –

cevap

0

böyle bir şey deneyin:

$(document).ready(function(){ 
    $('#button_id').on('click', function(){ 
     $('#text_id').hide();  // Set Id to the text you want to show 
     $('#message_id').show();  // Set Id to the message you want to hide 
    }); 
}); 
+0

Bunu denedim: http://pastebin.com/zbwRMUCU, ama benim için işe yaramadı. –

+0

lütfen bu –

+0

'u kullandığınız canlı bağlantıyı söz konusu ilk satırda kontrol edebilirsiniz veya [burada] (http://vikas.collagekingapp.com/zephyr-mechanix-battle-station-multicolor.html) –

İlgili konular