Virtuemart - kako prikazati osnovnu cijenu i cijenu s popustom ?

Autor darkookrad, 23. Veljača 2012, 16:21

0 Članovi i 1 Gost pregledava ovu temu.

darkookrad

Može li mi netko pomoći?

Kljent mi traži slijedeće:

kad se "login" kupac prijavi želim da se pored cijene koja je definirana određenim postotkom  za grupu kupaca kojoj pripada,
prikaže i osnovna cijena proizvoda te postotak za koji je ista snižena.

Naišao sam na jedan forum i čovjek kaže slijedeće:

***************************

Well this probably isn't the most elegant solution, but it works.  In your price.tpl.php file at the top you could do something like:

$base_price2 = ($base_price * .1) + $base_price;
echo 'Original Price: ' . $base_price2 . '<br />';


That will echo the original price without the 10% discount above your sell price.

************************
OVO GORE RADI I  TO JE OK, ALI:
************************


Now if you have different %'s on products then this wont work. you will have to do a simple database query using the product_price_id variable available in the price.tpl.php file and get the original price. It would look something like this:

$pid = $price_info['product_price_id'];

$db =& JFactory::getDBO();
$query = "SELECT `product_price` FROM `jos_vm_product_price` WHERE `product_id` = $pid";

$db->setQuery($query);

$result = $db->query();

echo 'Original Product Price: ' . $product_price;

***********************
OVAJ DIO mi NIKAKO NE FUNKCIONIRA!!???

Ima li netko kakvo rješenje?


Unaprijed zahvaljujem!


Darko