Author Topic: Display Product Attribute in Frontend  (Read 926 times)

AarthyV

  • Beginner
  • *
  • Posts: 1
Display Product Attribute in Frontend
« on: May 12, 2014, 13:10:27 pm »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27734
  • Always on vacation
    • Jenkin Hill Internet
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.8.0 10314 on Joomla 3.9.16 PHP 7.0.33

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9654
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Display Product Attribute in Frontend
« Reply #2 on: May 12, 2014, 13:28:14 pm »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation