function getProductBasicPriceInfo($obj, $price) { $jshopConfig = JSFactory::getConfig(); $price_show = $obj->weight_volume_units != 0; if (!$jshopConfig->admin_show_product_basic_price || $price_show == 0) { return array("price_show" => 0); } $units = JSFactory::getAllUnits(); $unit = $units[$obj->basic_price_unit_id]; $basic_price = $price / $obj->weight_volume_units * $unit->qty; return array("price_show" => $price_show, "basic_price" => $basic_price, "name" => $unit->name, "unit_qty" => $unit->qty); }
function getAddPrices() { $jshopConfig = JSFactory::getConfig(); $productprice = JSFactory::getTable('productprice', 'jshop'); $this->product_add_prices = $productprice->getAddPrices($this->product_id); $price = $this->getPriceWithParams(); $price_wp = $this->product_price; foreach ($this->product_add_prices as $k => $v) { if ($jshopConfig->product_price_qty_discount == 1) { $this->product_add_prices[$k]->price = $price - $v->discount; //discount value $this->product_add_prices[$k]->price_wp = $price_wp - $v->discount; } else { $this->product_add_prices[$k]->price = $price - $price * $v->discount / 100; //discount percent $this->product_add_prices[$k]->price_wp = $price_wp - $price_wp * $v->discount / 100; } } if (!$this->add_price_unit_id) { $this->add_price_unit_id = $jshopConfig->product_add_price_default_unit; } $units = JSFactory::getAllUnits(); $unit = $units[$this->add_price_unit_id]; $this->product_add_price_unit = $unit->name; if ($this->product_add_price_unit == "") { $this->product_add_price_unit = JSHP_ST_; } JDispatcher::getInstance()->trigger('onAfterGetAddPricesProduct', array(&$this)); }