Skip to content

Instantly share code, notes, and snippets.

@luizwbr
Created August 23, 2012 20:50
Show Gist options
  • Save luizwbr/3441552 to your computer and use it in GitHub Desktop.
Save luizwbr/3441552 to your computer and use it in GitHub Desktop.
Snippets Virtuemart 2.0
<?php
/**
* Canivete suiço do Joomleiro moderno #2
* - Códigos para VirtueMart 2.0
* weber.eti.br | virtuemartpro.com.br
* Luiz Weber @luizwbr
**/
// Virtuemart 2.0
// Carregando Produto manualmente
$product_model = VmModel::getModel('product');
$virtuemart_product_idArray = JRequest::getInt('virtuemart_product_id', 0);
if (is_array($virtuemart_product_idArray)) {
$virtuemart_product_id = $virtuemart_product_idArray[0];
} else {
$virtuemart_product_id = $virtuemart_product_idArray;
}
$product = $product_model->getProduct($virtuemart_product_id);
// carregando pedido manualmente
$orders = VmModel::getModel('orders');
$orderDetails = $orders->getOrder($cart->virtuemart_order_id);
## Constants
VMLANG = 'pt_br'
// carregando posições atributos personalizados fora do flypage
$position='bottom_produto';
if (!empty($product->customfields)) {
foreach ($product->customfields as $field) {
if ($field->layout_pos == $position) {
if ( $field->is_hidden ) //OSP http://forum.virtuemart.net/index.php?topic=99320.0
continue;
if ($field->display) {
echo "<div style='float:left'>".$field->display."</div>";
}
}
}
echo "<br style='clear:both' />";
}
// carregando atributos na tela do flypage
$position='bottom_produto';
if (!empty($this->product->customfieldsSorted[$position])) {
foreach ($this->product->customfieldsSorted[$position] as $field) {
if ( $field->is_hidden ) //OSP http://forum.virtuemart.net/index.php?topic=99320.0
continue;
if ($field->display) {
echo "<div style='float:left'>".$field->display."</div>";
}
}
echo "<br style='clear:both' />";
}
// Tutoriais
http://virtuemartpro.com.br/tutoriais.html
http://weber.eti.br/categorias/virtuemart/
// Plugins grátis
http://loja.weber.eti.br/downloads-gratis.html
http://virtuemartpro.com.br/download.html
// Fóruns Brasileiros
https://www.facebook.com/groups/virtuemartpro/
https://www.facebook.com/groups/270197296386106/
http://www.joomlaclube.com.br/site/forum/viewforum.php?f=73&sid=caaa89c60e3b9a9cf06b667662213d7b
http://www.fernandosoares.com.br/index.php?option=com_kunena&view=entrypage&defaultmenu=100021&Itemid=100020
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment