News:

Looking for documentation? Take a look on our wiki

Main Menu

Extract Custom Field value in cart

Started by Acolytte, February 02, 2014, 17:02:08 PM

Previous topic - Next topic

Acolytte

hi, i am altering mod_virtuemart_cart module. in mod_virtuemart_cart.php are those lines:

if(!class_exists('VirtueMartCart')) require(JPATH_VM_SITE.DS.'helpers'.DS.'cart.php');
$cart = VirtueMartCart::getCart(false);


which i think is gonna construct the VirtueMartCart object. this loop:

foreach ($data->products as $product){
//loop there
}


is able to go through the products in my cart. my question is, how can i access custom field in the loop above? i see it like this:

foreach ($data->products as $product){
$product->CustomFields[custom_field_id];
}


i have no idea how to acces the custom field object, if there is any, not i dont know if there is some function that can give me a custom field value from ID of custom field. if anybody knows, please help.