K
K
Konstantin2014-10-16 07:30:38
PHP
Konstantin, 2014-10-16 07:30:38

How to output data from PHP array (Virtuemart)?

I have Joomla 2.5 + Virtuemart + OnePageCheckout
It is necessary that the product SKU and a brief description be displayed in the shopping cart.
Judging by the component code, all information about the product is stored in an array named $product
For example, the product name is displayed as $product['product_name'].
I took the information from the array like this:
print_r($product);
and got this (here is only part of the code):

Array ( [product_full_image] => D:\_Install\openserver\domains\test.ru\images\stories\virtuemart\product\0132355_pe287994_s3.jpg [product_name] => LS-VI-APCIONGBCOS [product_attributes] => [product_sku] => LS-VI-APCIONGBCOS [product_quantity] => 1 [min_order_level] => [max_order_level] => [info] => stdClass Object ( [virtuemart_product_id] => 78 [virtuemart_vendor_id] => 1 [product_parent_id] => 77 [product_sku] => LS-VI-APCIONGBCOS [product_gtin] => white,green,wood [product_mpn] => [product_name] => LS-VI-APCIONGBCOS [slug] => товар-с-детями771 [product_s_desc] => Bulb type2 x G9 9W 240V Bulb not included

So, [product_name], [product_quantity] I can display, but product_sku and product_s_desc are empty.
Everything after the word Object cannot be displayed.
PS Site on localhost.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sharov Dmitry, 2014-10-16
@itrigger

stdClass Object is
an instance of the ArrayAccess class

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question