Sets the product data
@param integer $product_id
486155
protected function setProductProductBundle($product_id)
    {
        $this->data_product = $this->product->get($product_id);

        if (empty($this->data_product)) {
            $this->outputHttpStatus(404);
        }

        $this->prepareProductBundle($this->data_product);
    }
168209
public function indexProduct($product_id)
    {
        $this->setProduct($product_id);
        $this->setMetaIndexProduct();
        $this->setTitleIndexProduct();
        $this->setBreadcrumbIndexProduct();
        $this->setHtmlFilterIndexProduct();

        $this->setData('product', $this->data_product);

        $this->setDataSummaryIndexProduct();
        $this->setDataImagesIndexProduct();
        $this->setDataCartFormIndexProduct();
        $this->setDataRatingWidgetIndexProduct();

        $this->setDataDescriptionIndexProduct();
        $this->setDataAttributesIndexProduct();
        $this->setDataReviewsIndexProduct();
        $this->setDataRecentIndexProduct();
        $this->setDataRelatedIndexProduct();
        $this->setDataBundledIndexProduct();

        $this->setJsIndexProduct();
        $this->outputIndexProduct();
    }
667164
public function create($productId, ProductImage &$productImage)
    {
        $data = $productImage->exportData();
        $endpoint = '/admin/products/'.$productId.'/images.json';
        $response = $this->request(
            $endpoint, 'POST', array(
            'image' => $data
            )
        );
        $productImage->setData($response['image']);
    }
995845
public function delete($product_id, $check = true)
    {
        $result = null;
        $this->hook->attach('product.delete.before', $product_id, $check, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        if ($check && !$this->canDelete($product_id)) {
            return false;
        }

        $result = (bool) $this->db->delete('product', array('product_id' => $product_id));

        if ($result) {
            $this->deleteLinked($product_id);
        }

        $this->hook->attach('product.delete.after', $product_id, $check, $result, $this);
        return (bool) $result;
    }
996620
protected function setFieldFieldValue($field_id)
    {
        $this->data_field = $this->field->get($field_id);

        if (empty($this->data_field)) {
            $this->outputHttpStatus(404);
        }
    }
954827
protected function setIds(array $product)
    {
        $this->setLastEntityId(isset($product[MemberNames::ENTITY_ID]) ? $product[MemberNames::ENTITY_ID] : null);
    }
176306
protected function setTitleEditProduct()
    {
        if (isset($this->data_product['product_id'])) {
            $title = $this->text('Edit %name', array('%name' => $this->data_product['title']));
        } else {
            $title = $this->text('Add product');
        }

        $this->setTitle($title);
    }
982973
protected function setDataRelatedEditProduct()
    {
        $product_ids = $this->getData('product.related');

        $products = array();

        if (!empty($product_ids)) {
            $products = (array) $this->product->getList(array('product_id' => $product_ids));
        }

        $options = array(
            'entity' => 'product',
            'entity_id' => $product_ids,
            'template_item' => 'backend|content/product/suggestion'
        );

        foreach ($products as &$product) {
            $this->setItemThumb($product, $this->image, $options);
            $this->setItemPriceFormatted($product, $this->price);
            $this->setItemRendered($product, array('item' => $product), $options);
        }

        $widget = array(
            'multiple' => true,
            'name' => 'product[related]',
            'products' => $products,
            'error' => $this->error('related')
        );

        $this->setData('product_picker', $this->getWidgetProductPicker($widget));
    }
57032
private function logEvent(int $productId, int $storeId): void
    {
        $pageData = [];
        $pageData['store_id']           = $storeId;
        $pageData['cart']['product_id'] = $productId;

        $eventData = ['page' => $pageData, 'session' => $this->getSessionData()];

        $this->service->addEvent($eventData);
    }
333042
public function delete($product_id, array $options = array())
    {
        $result = null;
        $this->hook->attach('sku.delete.before', $product_id, $options, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        $sql = 'DELETE FROM product_sku WHERE product_id=?';

        if (!empty($options['combinations'])) {
            $sql .= ' AND LENGTH(combination_id) > 0';
        }

        if (!empty($options['base'])) {
            $sql .= ' AND LENGTH(combination_id) = 0';
        }

        $result = (bool) $this->db->run($sql, array($product_id))->rowCount();
        $this->hook->attach('sku.delete.after', $product_id, $options, $result, $this);
        return (bool) $result;
    }
1030692
protected function setDataDescriptionIndexProduct()
    {
        $description = $this->data_product['description'];

        if (!empty($description)) {
            $exploded = $this->explodeText($description);
            if (!empty($exploded[1])) {
                $description = $exploded[1];
            }
        }

        $rendered = $this->render('product/description', array('description' => $description));
        $this->setData('description', $rendered);
    }
733630
public void setProductListingIds(java.util.Collection<String> productListingIds) {
        if (productListingIds == null) {
            this.productListingIds = null;
            return;
        }

        this.productListingIds = new java.util.ArrayList<String>(productListingIds);
    }
947440
public function setProductId( $productid )
	{
		if ( $productid == $this->getProductId() ) { return; }

		$this->_values['ordprodid'] = (int) $productid;
		$this->setModified();
	}
688629
public function delete($product_id)
    {
        $result = null;
        $this->hook->attach('product.related.delete.before', $product_id, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        foreach (array('product_id', 'item_product_id') as $field) {
            if (!$this->db->delete('product_related', array($field => $product_id))) {
                return false;
            }
        }

        $this->hook->attach('product.related.delete.after', $product_id, $result, $this);
        return (bool) $result;
    }
88535
protected function setFieldValue($field_value_id)
    {
        $this->data_field_value = array();

        if (is_numeric($field_value_id)) {

            $conditions = array(
                'language' => 'und',
                'field_value_id' => $field_value_id
            );

            $this->data_field_value = $this->field_value->get($conditions);

            if (empty($this->data_field_value)) {
                $this->outputHttpStatus(404);
            }

            $this->prepareFieldValue($this->data_field_value);
        }
    }
1218891
public function setId( $id )
	{
		if ( ( $this->_values['id'] = MShop_Common_Item_Abstract::checkId($this->getId(), $id) ) === null ) {
			$this->_modified = true;
		} else {
			$this->_modified = false;
		}
	}
1150677
public function setProduct(ProductInterface $product)
    {
        $this->productId = $product->getId();
        $this->product = $product;
    }