Hello! I'm hearing that a customer reported this error message while trying to checkout of my client's store after I'd installed the USPS API patch:
Fatal error: Call to undefined method SimpleXMLElement::count() in /home/[sitename]/public_html/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php on line 479
The docs for SimpleXMLElement::count() say it's a function in PHP 5.3 and up, and the site is running on 5.2, so it seems an obvious fix would be to upgrade to 5.3, but when I tried changing to 5.3, I ran into an error message related to the custom theme on the site. In the previous upgrade on this site the custom theme was a bit of a pain to troubleshoot, so I don't relish trying to get it to behave with PHP 5.3 ... so I'm wondering, has anyone written a workaround version of the patch for their own site that checks for whether SimpleXMLElement::count() is a valid method, and if not, uses the alternative for 5.2 and below, as described in the comment section here?
TIA ~ JRD
Solved! Go to Solution.
do yourself a favor and upgrade to php 5.3. and fix your theme issues....
do yourself a favor and upgrade to php 5.3. and fix your theme issues....
Done, and it fixed the problem. Thanks.