Picking Value from Array for Woocommerce

May 02, 2022 01:38:54
Colemont
Topics: 7
Messages: 19
Is it possible to get a specific Value from this array, that is saved by woocommerce for use in e2pdf?

It is currently saved as order_item_meta in databse, but i would specifically need to use just value under 0,0,value string

[e2pdf-wc-order key="line_item" subkey="rn_line_items" index="0" order_item_meta="true"]

Array
(
[0] => stdClass Object
(
[Label] =>
[Id] => 1
[Type] => globalcontainer
[PriceType] => none
[Price] => 0
[SalePrice] => 0
[Quantity] => 1
[UnitPrice] => 0
[Value] => Array
(
[0] => stdClass Object
(
[Label] => Objekto pavadinimas
[Id] => 1
[Type] => text
[PriceType] => none
[Price] => 0
[SalePrice] => 0
[Quantity] => 1
[UnitPrice] => 0
[Value] => sdsdghsdgsdg <---------- THIS VALUE
)

[1] => stdClass Object
(
[Label] => Draudimas galioja nuo
[Id] => 2
[Type] => datepicker
[PriceType] => none
[Price] => 0
[SalePrice] => 0
[Quantity] => 1
[UnitPrice] => 0
[Unix] => 1651795200
[Value] => 2022 05 06
)

[2] => stdClass Object
(
[Label] => Draudimas galioja iki
[Id] => 3
[Type] => datepicker
[PriceType] => none
[Price] => 0
[SalePrice] => 0
[Quantity] => 1
[UnitPrice] => 0
[Unix] => 1652918400
[Value] => 2022 05 19
)

)

[GlobalId] => 1
[HideInCart] =>
[FieldName] =>
)

)
May 02, 2022 01:44:01
Colemont
Topics: 7
Messages: 19
Also it's a serialized object
May 02, 2022 02:49:18
Colemont
Topics: 7
Messages: 19
In other words - i have array (image attached), and i need a specific value shown in same image attached to be printed in PDF.

[e2pdf-wc-order key="line_item" subkey="rn_line_items" index="0" order_item_meta="true"] <- this shortcode only shows whole array. How do i modify it to pick only required Value?
May 02, 2022 04:27:51
E2Pdf
Topics: 7
Messages: 3617
Support
Hi,

Update plugin please to RC version 1.17.x by following steps in current topic: https://e2pdf.com/support/desk/how-to-update-plugin-to-rc-release-candidate-version-from-e2pdf-com

After update try please to use shortcode:
[e2pdf-wc-product key="rn_line_items" order_item_meta="true" index="0"]

Will it be same output?

P.S. Can you also please copy full value from PhpMyAdmin as text value here or somewhere so we can unserialize it manually to check the complete structure as it could be required to use PHP hook.

We would really appreciate your feedback at WordPress.org!
May 04, 2022 02:15:04
Colemont
Topics: 7
Messages: 19
I've already sold this problem by choosing other plugin with different structure on database. No array - no problems. You can close this topic :) Sorry for stealing your time
Get News and Updates
Our monthly newsletter keeps you in the loop, so you'll always be up to date with the latest news and updates about E2Pdf.
* You can update your email subscription preferences here.
All trademarks, service marks, trade names, product names, and logos appearing on this website are the property of their respective owners. The use of trademarks such as Formidable Forms®, Forminator Forms®, Gravity Forms®, JetFormBuilder®, WordPress®, WooCommerce®, WPForms® and others is solely for identification purposes (nominative use) and does not imply any affiliation, sponsorship, or endorsement by the respective trademark holders.
© 2017 - 2026, https://e2pdf.com

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. By clicking "Accept Selected", you consent to use of selected cookies according to our Cookie Policy.