0

When we click on "zip code" & enter "check" button,

enter image description here

Then we are displaying "Available with 14 sellers" , in front of that text, i want to display entered zip code : "110001".

I need :" Available with 14 sellers 110001 "

result.phtml

<p>
<?php echo "Available with 14 sellers";?>
</p>

<p>
<?php echo $this->htmlEscape($this->getFieldValue('postcode')) ?>
</p>

form.phtml

<?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 <?php if ($this->isFieldRequired('postcode')):?>
required-entry<?php endif;?> validate-length maximum-length-6 minimum-length-6 validate-digits" 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; ?> 

ex : please visit link1 & enter "110001" in textfield and click on "check" button.

  • can you share estimate action code in controller file? – Abdul Mar 30 '16 at 10:22
  • @Abdul please check here : pasted.co/3d673eba – user33510 Mar 30 '16 at 10:26
  • can you share also block "shipping.estimate.result" file code? – Abdul Mar 30 '16 at 10:30
  • check here , Result.php file : pasted.co/567720f8 – user33510 Mar 30 '16 at 10:41
1

try this but not sure

in file result.phtml

<p><?php echo "Available with 14 sellers";?>
<?php  $addressInfo = $this->getRequest()->getPost('estimate',array()); ?>
<?php if(isset($addressInfo['postcode']) && $addressInfo['postcode']):?>
<?php echo ' '.$this->htmlEscape($addressInfo['postcode']); ?>
<?php endif;?>
</p>
  • i will try this – user33510 Mar 30 '16 at 10:41
  • syntax error, unexpected ';' in $addressInfo = $this->getRequest()->getPost('estimate',array(); – user33510 Mar 30 '16 at 10:48
  • Sorry it is my issue. Updated ans pls check and let me know. – Abdul Mar 30 '16 at 10:49
  • its working now, but its displaying in 2 lines, i want in one line. – user33510 Mar 30 '16 at 10:55
  • updated ans pls check now – Abdul Mar 30 '16 at 10:56
2

that will show the input too

    <?php 

echo "Available with 14 sellers ".$this->getRequest()->getParam('id');  ?>
  • now for all zip codes , i am geting this message : "Available with 14 sellers 8931" – user33510 Mar 30 '16 at 10:41
  • that are static text what is relation between seller and zipcode – Qaisar Satti Mar 30 '16 at 10:44
  • same zip codes for all sellers in the site. let me know if i understood wrongly. – user33510 Mar 30 '16 at 10:47
  • i added the condition change as you required.. – Qaisar Satti Mar 30 '16 at 10:48
  • nw its displaying blank value when we enter check button – user33510 Mar 30 '16 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy