public function getUnique($sku, $store_id)
    {
        $existing = $this->get(array('sku' => $sku, 'store_id' => $store_id));

        if (empty($existing)) {
            return $sku;
        }

        $counter = 1;

        do {
            $modified = $sku . '-' . $counter;
            $counter++;
        } while ($this->get(array('sku' => $modified, 'store_id' => $store_id)));

        return $modified;
    }
public function getUnique($sku, $store_id)
    {
        $existing = $this->get(array('sku' => $sku, 'store_id' => $store_id));

        if (empty($existing)) {
            return $sku;
        }

        $counter = 1;

        do {
            $modified = $sku . '-' . $counter;
            $counter++;
        } while ($this->get(array('sku' => $modified, 'store_id' => $store_id)));

        return $modified;
    }
public function getUnique ( $ sku , $ store_id ) { $ existing = $ this -> get ( array ( 'sku' => $ sku , 'store_id' => $ store_id ) ) ; if ( empty ( $ existing ) ) { return $ sku ; } $ counter = 1 ; do { $ modified = $ sku . '-' . $ counter ; $ counter ++ ; } while ( $ this -> get ( array ( 'sku' => $ modified , 'store_id' => $ store_id ) ) ) ; return $ modified ; }
Returns a unique SKU for the given store ID
@param string $sku
@param integer|null $store_id
@return string
Returns a unique SKU for the given store ID