amazOOP amazOOP
[ class tree: amazOOP ] [ index: amazOOP ] [ all elements ]

Class: LiteDetails

Source Location: /liteDetails.class.php

Class Overview

AmazonItem
   |
   --LiteDetails
The LiteDetails class is used to store information on products returned when doing a lite request to AWS.

Author(s):

Version: 0.3RC1

Copyright: 2004 (c) Mauricio Diaz Orlich

Methods



Child classes:

HeavyDetails
The HeavyDetails class is used to store information on products returned when doing a heavy request to AWS.

Inherited Methods:

Class: AmazonItem

AmazonItem::getASIN()
Fetches the product's ASIN, or Amazon Standart Item Number.
AmazonItem::getListPrice()
The listed price of the item including its currency symbol.
AmazonItem::getOurPrice()
The price offered by Amazon for this product including its currency symbol.
AmazonItem::getProductName()
Decodes the product's name.
AmazonItem::getSavings()
Calculates the difference between Amazon's price and the list price.

Class Details [line 61]

The LiteDetails class is used to store information on products returned when doing a lite request to AWS.

All string values are encoded with native PHP function rawurlencode(). But are returned decoded by the corresponding accessor methods, which you are encouraged to use.

As of version 0.3RC1 this is a list of the information returned by AWS that is supported by amazOOP:




Tags:

Version:  0.3RC1
  
License:  GNU General Public License
  
Copyright:  2004 (c) Mauricio Diaz Orlich
  
Author:  Mauricio Diaz <madd0@users.sourceforge.net>
  
Link:  Amazon Web Services SDK


[ Top ]


Class Methods


method buyNow [line 647]

string buyNow( [string $text = ""], [boolean $img = false], [mixed $addAttributes = ""])

A remote "Add to Cart" form for the current product.

This function will genereate an "Add to Cart" form for the current product.




Tags:

Return:  An "Add to Cart" form for this product.
  
Since:  version 0.2 the $locale parameter has been dropped. It must not be used anymore.


Parameters:

string   $text   is the text that should be used in the button. If a blank string is submitted, the default value is used.
boolean   $img   if set to true, instead of a regular button an image is used. The image's URL is set in $buyNowImg in the config.inc.php. If this is set to true, the $text parameter is used as the ALT text for the image.

[ Top ]

method getArtists [line 344]

string|boolean getArtists( [integer $howmany = 0], [string $separator = ", "], [string $etc = "et al."], [string $template = "%name%"])

Displays the musicians of a CD or cassette.

You can specify how many artists you want to display, what character(s) should separate each name and what should be appended at the end of the list if there are more artists than were displayed.

Additionally, since version 0.2, you can add a template that will be applied to each name. This allows to create links, and apply other html transformation to each name in the list.




Tags:

Return:  A list of artists. Or false if there are no artists.


Parameters:

integer   $howmany   indicates how many artists you want to display. If the value is zero or is greater than the total number of available artists, all artists are displayed.
string   $separator   determines what character(s) separate each name. The default value is a comma followed by a space.
string   $etc   is the text appended to the end of a partial list of artists. The default value is "et al.", but it could be something like "etc.", "and others", etc.
string   $template   a template to be applied to each name on the list. The default value is "%name%" wich will display the name unmodified. You can submit templates such as "%name%", which will display each name in bold characters, but not the separators, or something like "<a href=\"/artist/%rawName%\">%name%</a>", which will create a link to a page using the URL encoded artist's name.

[ Top ]

method getAuthors [line 288]

string|boolean getAuthors( [integer $howmany = 0], [string $separator = ", "], [string $etc = "et al."], [string $template = "%name%"])

Displays the authors of a book.

You can specify how many authors you want to display, what character(s) should separate each name and what should be appended at the end of the list if there are more authors than were displayed.

Additionally, since version 0.2, you can add a template that will be applied to each name. This allows to create links, and apply other html transformation to each name in the list.




Tags:

Return:  A list of authors. Or false if there are no authors.


Parameters:

integer   $howmany   indicates how many authors you want to display. If the value is zero or is greater than the total number of available authors, all authors are displayed.
string   $separator   determines what character(s) separate each name. The default value is a comma followed by a space.
string   $etc   is the text appended to the end of a partial list of authors. The default value is "et al.", but it could be something like "etc.", "and others", etc.
string   $template   a template to be applied to each name on the list. The default value is "%name%" wich will display the name unmodified. You can submit templates such as "%name%", which will display each name in bold characters, but not the separators, or something like "<a href=\"/author/%rawName%\">%name%</a>", which will create a link to a page using the URL encoded author's name.

[ Top ]

method getAvailability [line 624]

string|bollean getAvailability( )

Shows the product current availability as indicated by Amazon.

Apparently in AWS4 availability will come (at last!) as a code and as a string. When (if) this happens, this function will receive a boolean parameter to determine which format you want.




Tags:

Return:  The product's availabiity. Or false there is no availability set.


[ Top ]

method getCatalog [line 255]

string|boolean getCatalog( )

Decodes the catalog. The catalog determines which "aile" of the Amazon store this product belongs to. This seems to be in English in all locales.



Tags:

Return:  The product's catalog. Or false if the catalog is not set.


[ Top ]

method getImage [line 448]

string|array getImage( [string $size = "small"], [boolean $makeTag = false], [string $addAttr = ""])

This function will return either the IMG or the URL for the specified image size.

If the image returned by Amazon is a "non-image" (i.e. 1x1 transparent gif) the default image for the specified size is returned. The URLs for the default images are stored in $defaultImages, which is located in the config.inc.php file.

This function alse tries go around some AWS bugs:

  • when a product is imported (e.g. English books in Amazon.co.jp) their images should be accessed using Amazon.com's store code (01) instead of Amazon.co.jp's (09). If an image is not returned, amazOOP tries different store codes to go around this. For more information on this problem, read this
  • when a product is provided by a Third Party Seller (such as products in the apparel, gourmet, sports, jewelry and watch catalogs, which by the way are not officially supported) the image's name should include the merchant's ID, but AWS doesn't return it like that, therefore amazOOP tries to go around this by, first, trying to use the merchant ID AWS provides (if a merchant ID is provided) or, second, tries a list of frequently used merchant IDs which can be configured in stores.inc.php. Be aware that this is a crude and time-expensive hack to go around this and can be turned off. To avoid going through the whole list of merchants, what you should do is erase everything but the first 5 entries from array $storeCodes, which is in file stores.inc.php.




Tags:

Return:  either an IMG tag to display the requested image, or an array with the following information:
  • 'url': the URL of the image
  • 'width': the image's width
  • 'height': the image's height


Parameters:

string   $size   the image's size. Can be "small", "medium" or "large"
boolean   $makeTag   whether the IMG tag should be created or not
string   $addAttr   additional attributes to be included in the IMG tag if it was created.

[ Top ]

method getManufacturer [line 403]

string|boolean getManufacturer( [string $template = "%name%"])

Manufacturer of product. Can represent publishers (for books), labels (for music) or studios (for films).

Additionally, since version 0.2, you can add a template that will be applied to the name. This allows to create links, and apply other html transformation to the manufacturer's name.




Tags:

Return:  Product's manufactuer. Or false if no manufacturer is set.


Parameters:

string   $template   a template to be applied to the manufacturer's name. The default value is "%name%" wich will display the name unmodified. You can submit templates such as "%name%", which will display the name in bold characters, or something like "<a href=\"/artist/%rawName%\">%name%</a>", which will create a link to a page using the URL encoded manufacturer's name.

[ Top ]

method getMerchantId [line 698]

string|boolean getMerchantId( )

The merchant ID of a Third Party Seller.

This appears when a product is not offerd by Amazon, only by a Third Party Seller.




Tags:

Return:  The merchant ID, or false if none is set.


[ Top ]

method getReleaseDate [line 380]

string|boolean getReleaseDate( )

Decoded version of the date the product was or is supposed to be released to the market.



Tags:

Return:  Product's release date. Or false if no date is set.


[ Top ]

method getStatus [line 608]

string|boolean getStatus( )

Indicates if any errors were encountered while processing the service request.



Tags:

Return:  The request status. Or false there is no status set.


[ Top ]

method getURL [line 180]

string|boolean getURL( [string|boolean $makeLink = false], [string $linkAttributes = ""], [string $additionalArguments = ""], [string $type = "html"])

Can generate a hyperlink to the product details page at Amazon, or simply return the URL to this page.



Tags:

Return:  Either the URL to the details page of the product on Amazon, or the generated hyperlink. Or false if the URL is not set.


Parameters:

string|boolean   $makeLink   is used to indicate whether a link should be created. Accepted values are:
  • false: no link is created, only the URL is returned
  • "name": a link is created displaying the name of the product between the anchor tags (<a>)
  • "small": a link is created displaying the small version of the product's image
  • "medium": a link is created displaying the medium version of the product's image
  • "large": a link is created displaying the large version of the product's image
  • "special": a link is created using the string provided through the $special parameter
string   $linkAttributes   any additional attributes to be added to the anchor tag (<a>) such as style, onmouseover, etc.
string   $additionalArguments   when $makeLink is set to "special", the value of this parameter is used as text for the link created. If $makeLink is set to any of the images, this parameter is used to add information to the IMG tag, such as border (which is 0 if not specified), alignment, etc.
string   $type   this experimental feature allows to obtain links for pages designed for specific browsers in Amazon (i.e. WAP browsers, PDAs, etc.) the default is "html" for a classic Amazon page. Accepted values are:
  • "html": link to the classic Amazon.com product details page
  • "wap": link to a WAP version of the Amazon.com product details page
  • "pda": link version adapted for PDAs of the Amazon.com product details page
  • "text": link to the text-only version of the Amazon.com product details page
NOTE that types different than "html" have only been tested to work with the "us" locale.

[ Top ]

method getUsedPrice [line 596]

string|boolean getUsedPrice( )

The lowest used price in Amazon Marketplace.



Tags:

Return:  the lowest used price for a product in Amazon Marketplace. Or false if no used price was returned.


[ Top ]

 
Documentation generated on Sat, 21 Aug 2004 17:40:38 +0200 by phpDocumentor 1.3.0RC3
hosted by
SourceForge.net Logo