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:
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.
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.
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.
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.
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.
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.
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.