VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Coding Central => Topic started by: QQ on August 25, 2017, 23:23:04 PM

Title: CurrencyDisplay Outside VirtueMart
Post by: QQ on August 25, 2017, 23:23:04 PM
I need to get Rows calculations outside VirtueMart. It can be done by:

shopFunctionsF::calculateProductRowsHeights($products,$currency,$products_per_row);

I got $products, $products_per_row but don't know how to get $currency. If I print out $currency at templates/My template/html/com_virtuemart/sublayouts/products.php I get CurrencyDisplay Object.

And class CurrencyDisplay can't be reached from outside. Any ideas what to send instead CurrencyDisplay Object. Or how to get it outside?
Title: Re: CurrencyDisplay Outside VirtueMart
Post by: Milbo on August 26, 2017, 08:45:01 AM
the function calculateProductRowsHeights calculates the HEIGHT! of a row. It has nothing todo with prices
Title: Re: CurrencyDisplay Outside VirtueMart
Post by: QQ on August 26, 2017, 11:49:57 AM
Quote from: Milbo on August 26, 2017, 08:45:01 AM
the function calculateProductRowsHeights calculates the HEIGHT! of a row. It has nothing todo with prices
I didn't talk about price.  :)
I was saying "I need to get Rows calculations outside VirtueMart."
to get that I need $currency->_priceConfig


$priceRows = 0;
//Lets calculate the height of the prices
foreach($currency->_priceConfig as $name=>$values){
if(!empty($currency->_priceConfig[$name][0])){
       if(!empty($product->prices[$name]) or $name == 'billTotal' or $name == 'billTaxAmount'){
              $priceRows++;
}
}
}


and later I will need it at this function:
echo shopFunctionsF::renderVmSubLayout('prices',array('product'=>$product,'currency'=>$currency)); ?>

That's the only think left that I don't have.
Everything is set by CurrencyDisplay class that I can't reach from outside.
Title: Re: CurrencyDisplay Outside VirtueMart
Post by: QQ on August 26, 2017, 16:44:26 PM
I quit the idea to get joomla search view same as virtuemart products.
I will import joomla search into virtuemart. Not what I wanted but faster with skills I have at the moment.

Just explain why You guys left advanced search  so unfinished?..
While everything else in virtuemart feels  finished till last touch.
Title: Re: CurrencyDisplay Outside VirtueMart
Post by: jenkinhill on August 26, 2017, 17:06:25 PM
There are many different user search methods that VM users like to use, and you no one method cam match everybodies needs. So there is a range of plugins to provide those requirements, eg http://extensions.virtuemart.net/product/products/ajax-search-pro-detail  or  http://extensions.virtuemart.net/product/products/ebay-instant-keyword-search-detail
Title: Re: CurrencyDisplay Outside VirtueMart
Post by: QQ on August 26, 2017, 17:19:15 PM
I am not talking about fit all needs.
Basic advanced search I think is more or less enough, like joomla offer now. Just view of a products like in category. 
I would come and help You do this, but I got basic understanding about classes and joomla it self :)   
Title: Re: CurrencyDisplay Outside VirtueMart
Post by: Milbo on August 27, 2017, 15:43:47 PM
First:

The function shopFunctionsF::calculateProductRowsHeights calculates Heights! It does not display a product or calculate prices. It is a template thing.

There are two searches. One is part of the category view and there is also a search module for it and we have a plugin, which is a bit outdated. But it works.