News:

Looking for documentation? Take a look on our wiki

Main Menu

Display Product Attribute in Frontend

Started by AarthyV, May 12, 2014, 13:10:27 PM

Previous topic - Next topic

AarthyV

Hi,

I want to retrieve the value of product_attribute from virtuemart_order_items table and want to display in the same order as shown in checkout page.

I am using customer text input plugin in Vm2 for each product so that the user can type their comment for that product.

For example,
Comment: good
Saved in the database as {"134":{"textinput":{"comment":"good"}}

So how to retrieve "good" from the database.

Using:
Joomla 2.5
Virtuemart 2.0


Thanks in advance
AarthyV

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

GJC Web Design

you don't say what column this is saved to  - but you access that in your template as any other node
It is in json format so you need to   php  json_decode($your_var) which will give you an object

also the example you give is syntax incorrect - missing a closing brace

{"134":{"textinput":{"comment":"good"}}}
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation