getOfferItems - www-getstorify-com/getstorify-offers-php-sdk GitHub Wiki

(Since v1.x)

getOfferItems - This method will fetch all the items of an offer of ACTIVE store of a user.

Parameters:

  • storeid (Mandatory)
  • offerid (Mandatory)
  • offer_itemid
  • offer_itemname
  • item_categoryid
  • page
  • pagelimit

Fetch items of an offer of a store

Pass storeid and offerid to fetch items of an offer of a store.

Note! Offer can be LIVE or EXPIRED and items will be in ACTIVE state.

Example

Fetch items of an offer having id gsOffer1 of store having id gsStore1.

$offerItemsResult = $GetStorifyOffersObj->getOfferItems(
  $storeid = "gsStore1",
  $offerid = "gsOffer1"
);

Fetch specific item of an offer

Pass the offer_itemid to fetch specific item of an offer.

Example

Fetch item having id gsItem1 of an offer having id gsOffer1 of the store having id gsStore1.

$offerItemsResult = $GetStorifyOffersObj->getOfferItems(
  $storeid = "gsStore1",
  $offerid = "gsOffer1",
  $offer_itemid = "gsItem1"
);

Fetch items by name of an offer

Pass the offer_itemname to fetch items by name of an offer.

Example

Fetch items of an offer having name Protein.

$offerItemsResult = $GetStorifyOffersObj->getOfferItems(
  $storeid = "gsStore1",
  $offerid = "gsOffer1",
  $offer_itemid = null,
  $offer_itemname = "Protein"
);

Fetch items by category id

Pass item_categoryid to fetch items by category id.

Example

Fetch items that have category id Foodgrains.

$offerItemsResult = $GetStorifyOffersObj->getOfferItems(
  $storeid = "gsStore1",
  $offerid = "gsOffer1",
  $offer_itemid = null,
  $offer_itemname = null,
  $item_categoryid = "Foodgrains"
);

Fetch offers page wise

By default, each page will hold max 10 records. So, page 1 will return first 10 offers. Page 2 will return the next 10 and so on.

Example

Fetching page 1.

$offerItemsResult = $GetStorifyOffersObj->getOfferItems(
  $storeid = "gsStore1",
  $offerid = "gsOffer1",
  $offer_itemid = null,
  $offer_itemname = null,
  $item_categoryid = null,
  $page = 1
);

Fetch offers with page limit

Pre page can have max 10 records. Pass the pagelimit to control the total records fetched per page.

Example

Fetching 5 records per page.

$offerItemsResult = $GetStorifyOffersObj->getOfferItems(
  $storeid = "gsStore1",
  $offerid = "gsOffer1",
  $offer_itemid = null,
  $offer_itemname = null,
  $item_categoryid = null,
  $page = 1,
  $pagelimit = 5
);