Hello,
I have a question regarding the product module, I want to display a product with their custom fields. Unfortunately i run into a problem regarding the custom fields. If I use the following rendersublayout:
<?php echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$product,'position' => array('ontop', 'addtocart'))); ?>
Only the add to cart button gets rendered. I checked and it is because the customfieldsSorted is empty:
if (!empty($product->customfieldsSorted[$position])) { ...
Can someone help me out?
I get the product the following way:
$productModel = VmModel::getModel('Product');
$product = $productModel->getProduct(2);
$productModel->addImages($product);
Found the solution:
$products = array();
$products[] = $product;
shopFunctionsF::sortLoadProductCustomsStockInd($products,$productModel);
$product = $products[0];