Skip to content

Commit

Permalink
Merge pull request #140 from zealnagar/master
Browse files Browse the repository at this point in the history
Bug solved for previous link in ShopifyResounce
  • Loading branch information
tareqtms authored Feb 17, 2020
2 parents 763cf8f + 742ec1e commit 16c3315
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/ShopifyResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ public function processResponse($responseArray, $dataKey = null)

public function getLinks($responseHeaders){
$this->nextLink = $this->getLink($responseHeaders,'next');
$this->prevLink = $this->getLink($responseHeaders,'prev');
$this->prevLink = $this->getLink($responseHeaders,'previous');
}

public function getLink($responseHeaders, $type='next'){
Expand All @@ -562,7 +562,6 @@ public function getLink($responseHeaders, $type='next'){
}

if(!empty($responseHeaders['link'])) {
var_dump($responseHeaders['link']);
if (stristr($responseHeaders['link'], '; rel="'.$type.'"') > -1) {
$headerLinks = explode(',', $responseHeaders['link']);
foreach ($headerLinks as $headerLink) {
Expand Down

0 comments on commit 16c3315

Please sign in to comment.