This topic contains 2 replies, has 0 voices, and was last updated by fredpope 9 years, 1 month ago.
-
AuthorPosts
-
September 23, 2015 at 6:37 am #6849
UIELHello,
I’m able to get the correct lists of items returned, but so far unable to join the result with the pricing of the respective items retrieved. I’ve tried joining the ItemSearchBasic with PricingSearchBasic, it returns the correct items but still missing the pricing field. There is a saved search saved up which adds the basePrice to the retrieved item, but it won’t cover all the cases I’m looking to implement.
So with the PHP toolkit 2015_1, how can I retrieve the pricing information of an item?
Thanks for any help!
This is a cached copy. Click here to see the original post. -
September 23, 2015 at 8:11 am #6850
UIELFound the fix after a few hours, felt that it should’ve been something obvious.
I always received null in the pricingMatrix because the bodyFieldsOnly property of SearchPreferences was set to true
-
September 23, 2015 at 8:56 am #6851
fredpopeHere is another approach to getting some pricing via the PHP kit instead of using a search.
function load($id, $type) {
//error_log(“Contacting Netsuite Via Web Services”);
$request = new GetRequest();
$request->baseRef = new RecordRef();
$request->baseRef->internalId = $id;
$request->baseRef->type = $type;
$getResponse = $this->service->get($request);
// get me my product
$product = $getResponse->readResponse->record;
// Now get some Pricing Information :
if (is_object($product->pricingMatrix->pricing)) {
foreach ($product->pricingMatrix->pricing as $pricing) {
// echo “
” . $pricing->priceLevel->name . ” – “;// echo $pricing->priceList->count;
if ($pricing->priceLevel->name == “Online Price”) {
foreach ($pricing->priceList->price as $onlinePrice)
{
$product->onlinePrice = $onlinePrice->value;
error_log(“ONLINE PRICE” . $onlinePrice->value);
}
}
I would not use this literally, but should give you the general idea.
-
AuthorPosts
You must be logged in to reply to this topic.