Exemplo n.º 1
0
function findProductByPath($path)
{
    $pid = \cf\Product::findByPath($path);
    if (!$pid) {
        return false;
    }
    $product = new \cf\Product($pid);
    $product->fullDescr();
    return $product->toArray();
}
Exemplo n.º 2
0
function getProduct($id)
{
    if (!$id) {
        return array();
    }
    $product = new \cf\Product($id);
    $groups = new \cf\ProductGroups($id, true);
    return array('id' => $product->id(), 'code' => $product->code(), 'name' => $product->name(), 'fullName' => $product->fullName(), 'price' => $product->price(), 'groups' => $groups->IDs(), 'attributes' => $product->attributes()->values(), 'manufacturerName' => $product->manufacturerName(), 'manufacturerId' => $product->manufacturerId(), 'image' => $product->image(), 'rating' => $product->rating(), 'images' => $product->images(), 'imageTexts' => $product->imageTexts(), 'shortDescr' => $product->shortDescr(), 'fullDescr' => $product->fullDescr(), 'sellerId' => $product->sellerId(), 'sellerName' => $product->sellerName(), 'sellerLink' => $product->sellerLink(), 'link' => $product->link(), 'article' => $product->article(), 'state_id' => $product->stateId(), 'state' => $product->state());
}