News:

Looking for documentation? Take a look on our wiki

Main Menu

sublayouts in plugin and modeles

Started by olejenya, October 24, 2015, 16:53:12 PM

Previous topic - Next topic

olejenya

Hey, do quick plugin, I render sablayauty in the plugin?

public function onAfterRender(){ 
if (!class_exists( 'VmConfig' )) require(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'helpers'.DS.'config.php');
VmConfig::loadConfig();
if (!class_exists( 'shopFunctionsF' )) require(JPATH_SITE.DS.'components'.DS.'com_virtuemart'.DS.'helpers'.DS.'shopfunctionsf.php');
$product_model = VmModel::getModel('product');
$prods = array($_GET['product_id']);
$product = $product_model->getProduct($prods);
<?php echo shopFunctionsF::renderVmSubLayout('addtocartquick.',array('product'=>$product)); ?>
}


does not work, what's wrong? what code to add?
The module can be displayed

echo shopFunctionsF::renderVmSubLayout('products_horizon',array('products'=>$products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));

Currently using VM3.0.10 on Joomla 3.4.5 PHP 5.4.29

Milbo

$prods = array($_GET['product_id']);

Please use vRequest::getInt('product_id') and I think 'addtocartquick.' should be without .
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

olejenya

Quote from: Milbo on October 25, 2015, 16:14:41 PM
$prods = array($_GET['product_id']);

Please use vRequest::getInt('product_id') and I think 'addtocartquick.' should be without .

Thanks, I'll try

olejenya

Hello. Who can answer how to use sublayouts products_horizon.php in mod_virtuemart_product? It would be cool to be downloaded to the module.

Milbo

comes in the membership version vm3.0.12.2. It is already in the svn.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/