/** * Method to display input to upload images * @param int $product_id * @return html */ public function onJ2StoreProductFormInput($product_id) { $vars = new JObject(); //check product id exist if (isset($product_id)) { //get the article item $article = J2StoreItem::getArticle($product_id); //get the j2store price for the above item $price = J2StoreItem::_getJ2Item($product_id); //assign the product id into vars $vars->product_id = $product_id; if (isset($price->additional_image)) { $vars->additional_image = json_decode($price->additional_image); } $vars->asset_id = $article->asset_id; } //check asset id exist else get from app if (!isset($vars->asset_id)) { $vars->asset_id = JFactory::getApplication()->input->get('option'); } //check already main image exist $vars->main_image = isset($price->main_image) ? $price->main_image : ""; $vars->listview_thumb = isset($price->listview_thumb) ? $price->listview_thumb : ""; $vars->no_of_additional_image = $this->params->get('no_of_additional_img', 5); //load the layot and return the result $result = $this->_getLayout('default', $vars); return $result; }
public static function getTaxProfileId($product_id) { $row = J2StoreItem::_getJ2Item($product_id); return $row->item_tax; }