Created
November 6, 2015 11:48
-
-
Save maxout/fa98a0cddbf8932d1a3e to your computer and use it in GitHub Desktop.
Sprd:getCheckoutUrl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Retrieve Basket Checkout URL | |
| * Returns the checkout URL for the current basket that will used in the iFrame on shop checkout. | |
| * @param $basketUrl | |
| * @param $namespaces | |
| * @return string | |
| */ | |
| private function getCheckoutUrl($basketUrl, $namespaces) | |
| { | |
| $basketXml = simplexml_load_file($basketUrl); | |
| foreach($basketXml->links->link as $link){ | |
| if((string)$link['type'] == 'shopCheckout') | |
| $checkoutUrl = (string)$link->attributes($namespaces['xlink']); | |
| } | |
| return $checkoutUrl; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment