Hello, i dont find answer in other post's.
VM: 3.2.14
J: 3.6.5
demo link: http://test.ccy.pl/en/sklep/wszystkie-produkty/interfejsy-lpg/adapter-for-stefanelli-sis-plus-detail
I prepared list of shipments ways with pirces gemerated from published shipments:
(https://image.ibb.co/eMHF4o/2018_06_27_11_53_26_LPG_Interfaces_Adapter_for_Stefanelli_SIS_PLUS.png)
but when i change currency prices of shipment not calculating
(https://image.ibb.co/cKcbAT/2018_06_27_11_55_15_LPG_Interfaces_Adapter_for_Stefanelli_SIS_PLUS.png)
my code:
$methods = VmModel::getModel('Shipmentmethod') -> getShipments();
foreach ($methods as $item) {
if ($item -> published == 1) {
$shipment_parms = $item -> shipment_params;
$just_price = explode('|', $shipment_parms);
$float_price = round(preg_replace('/[^0-9.]/', '', $just_price[14]) * 1.23, 2);
if ($float_price < 40)
echo '<span>' . $item -> shipment_name . '</span>' . '<span style="float:right">' . number_format($float_price, 2) . ' ' . $displayCurrency -> currency_symbol . '</span>
<br> ';
}
please help
You have to calculate the price with currency, look at prices.php to get some ideas.
regards
Jörgen @ Kreativ Fotografi
Thanks for reply!
i think i should use function:
public function createPriceDiv($name,$description,$product_price,$priceOnly=false,$switchSequel=false,$quantity = 1.0,$forceNoLabel=false, $force = false)
sorry but im java programmer and i dont know syntax of php, if you can please tell me how to use method from currencydisplay.php file in
/components/com_virtuemart/sublayouts/addtocart.php file
Try this:
$currency = $viewData['currency'];
Jörgen @ Kreativ Fotografi
i have this error
Fatal error: Call to a member function createPriceDiv() on a non-object in /home/scalp/public_html/test/components/com_virtuemart/sublayouts/addtocart.php on line 68
OK the viewdata don´t include the currency, then add this to the call of the sublayout. Check the call to prices.php sublayout and do the same.
regards
Jörgen @ Kreativ Fotografi
Thanks for trying help but i still can't do it... ???
include
if (!class_exists ('CurrencyDisplay')) {
require(VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php');
}
$currency = CurrencyDisplay::getInstance();
And after use it with
$currency->priceDisplay($YOURPRICE);
Thanks! WORKING !!! :)