VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: olejenya on October 24, 2015, 16:53:12 PM

Title: sublayouts in plugin and modeles
Post by: olejenya on October 24, 2015, 16:53:12 PM
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
Title: Re: sublayouts in plugin and modeles
Post by: 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 .
Title: Re: sublayouts in plugin and modeles
Post by: olejenya on October 26, 2015, 23:26:24 PM
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
Title: Re: sublayouts in plugin and modeles
Post by: olejenya on December 15, 2015, 18:12:35 PM
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.
Title: Re: sublayouts in plugin and modeles
Post by: Milbo on December 16, 2015, 19:53:09 PM
comes in the membership version vm3.0.12.2. It is already in the svn.