Displaying needed CustomFields and manufact.name in Basket

Please post your issues and questions about One Page Checkout for Virtuemart 2 to this forum.

Displaying needed CustomFields and manufact.name in Basket

Postby armands.upmalis@.....lv » Mon Sep 17, 2012 6:50 pm

Hello!
Is it possible in OnePage Checkout Cart view display needed (NOT ALL) customfields and manufacturer name? I couldn't do it...

In VM Category view I use such:
Code: Select all
echo $product->mf_name //for displaying manufacturer name;
$product->customfields[X]->custom_value // for displaying needed customfield


But in OnePage Chechout ....com_onepage/themes/my_theme/overrides/basket.html.php this syntax don't work=displays nothing!

Thank You!
armands.upmalis@.....lv
 
Posts: 2
Joined: Mon Sep 17, 2012 6:44 pm

Re: Displaying needed CustomFields and manufact.name in Basket

Postby armands.upmalis@.....lv » Wed Sep 19, 2012 2:12 pm

Hello!

Any suggestions, tips?

How in OnePage Checkout product cart I can display CustomFields (not all but just CustomField X, CustomFieldY and CustomFieldZ etc.) and Manufactuer Name?

Thank You!
armands.upmalis@.....lv
 
Posts: 2
Joined: Mon Sep 17, 2012 6:44 pm

Re: Displaying needed CustomFields and manufact.name in Basket

Postby admin » Wed Sep 19, 2012 5:44 pm

Hello, i added this to the next version so you can show the mf_name. I don't have any extension for the custom fields right now installed on my demo but it should be working well. In current versions you can use:
$product['product']->virtuemart_manufacturer_id;

and in the following releases, i added new variable $product['info'] which is a full object of the product including it's mf name. I added info and an example into:
\components\com_onepage\themes\icetheme_thestore\overrides\basket.html.php inside of the product foreach section.

Code: Select all
foreach( $product_rows as $product ) {

/*
DEVELOPER INFORMATION
If you need any other specific information about the product being showed in the basket you can use the following variables in the theme:
$product['info'] is an instance of VirtueMartModelProduct->getProduct($product['product_id'], $front=true, $calc=false, $onlypublished=false);

To get instance of the single product information associated with the cart without any extra info, you can use:
$product['product']

All of the variables used in this file are defined in:
\components\com_onepage\helpers\loader.php
Please don't modify loader.php if you plan to update OPC on bug fix releases.

Tested Example to show manufacturer info:


if (!empty($product['info']->virtuemart_manufacturer_id))
{
echo $product['info']->mf_name;
}
*/
?>
  <div class="op_basket_row">



To check your custom fields, just use:
var_dump($product['info']); var_dump($product['product']); die(); to see all of the variables associtated.

Best Regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 2