News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

The variable $viewData['product'] does not return any value

Started by mar22, October 05, 2015, 19:31:51 PM

Previous topic - Next topic

mar22

Hello

sorry for my English :(

I have a problem with selecting a variable: $ViewData['product'], so I moved the script from the file:

com_virtuemart/sublayouts/customfields.php

to file:

com_virtuemart/productdetails/default.php

and this variable not return any parameters :(

The beginning of the script looks like this:

$product = $viewData['product'];
// Availability
$stockhandle = VmConfig::get('stockhandle', 'none');
$product_available_date = substr($product->product_available_date,0,10);


Does anyone know how to run this variable? to the variable $product they have been transferred to the data?

I would be very grateful for your help.

regards
Marcin

PRO

productdetails template uses

$this->product


what data are you trying to get from customfields?


mar22

Thank you very much for your help, in fact enough to use the syntax:

$product = $viewData['product'];
// Availability
$stockhandle = VmConfig::get('stockhandle', 'none');
$product_available_date = substr($this->product->product_available_date,0,10);


instead

$product = $viewData['product'];
// Availability
$stockhandle = VmConfig::get('stockhandle', 'none');
$product_available_date = substr($product->product_available_date,0,10);


Now everything works perfectly

Once again, thank you very much for your help

Problem solved

regards
Marcin