Post by alex067 » Thu Jul 27, 2017 12:47 pm

At my success.php page, I successfully grabbed the product id's of what the customer bought. However I am having trouble finding the product name of these id's.

As a test, I just echo'd the $productName which should grab the product name of the id = '50'
$productName = $this->model_catalog_product->getProduct('50');
echo $productName;

However i receive the array of an array to string conversion. Can anyone help?

New member

Posts

Joined
Wed Jul 12, 2017 9:50 am

Post by uksitebuilder » Fri Jul 28, 2017 6:41 pm

That’s because the getProduct() method returns an array

Do something like the following instead:

Code: Select all

$product = $this->model_catalog_product->getProduct('50');
echo $product['name'];

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom
Who is online

Users browsing this forum: daniil_oc, pprmkr, WaxedPerfection and 463 guests