Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Help Retrieving Shipping Postcode Variable
 
oliverscarlett
Jr. Member
 
Total Posts:  15
Joined:  2008-04-10
 

In flatrate.php, I’m trying to extract the first three characters of the postcode estimate in the cart. Something along these lines:

$postprefix substr('postcode'03);
if(
$postprefix == 'FSA'){
return false;
}

But of course, $postprefix is always equal to “pos”.

I suspect both my syntax and the postcode variable name are wrong. Can someone help?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
oliverscarlett
Jr. Member
 
Total Posts:  15
Joined:  2008-04-10
 

I think I got it but if there’s something wrong with the logic please let me know!

$postcode $request->getDestPostcode();
$postprefix substr($postcode03);
if(
$postprefix == 'FSA'){
return false;
}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top