Skip to content

Instantly share code, notes, and snippets.

@bstonedev
Last active February 11, 2020 00:24
Show Gist options
  • Save bstonedev/84bac4ca717669b650dffad942349d6d to your computer and use it in GitHub Desktop.
Save bstonedev/84bac4ca717669b650dffad942349d6d to your computer and use it in GitHub Desktop.
Example output of single product object - retrieved via `$cart_obj->get_cart();` then `print_r($value)` in loop
Array(
[key] => ############################
[product_id] => 57317
[variation_id] => 0
[variation] => Array()
[quantity] => 1
[data_hash] => ##########################
[line_tax_data] => Array(
[subtotal] => Array()
[total] => Array()
)
[line_subtotal] => 110
[line_subtotal_tax] => 0
[line_total] => 110
[line_tax] => 0
[data] => WC_Product_Simple Object(
[object_type:protected] => product
[post_type:protected] => product
[cache_group:protected] => products
[data:protected] => Array(
[name] => Cairns Dive Centre <br>1 Day MV Sunkist: Snorkel Day Trip
[slug] => cairns-dive-centre-1-day-mv-sunkist-snorkel-day-trip
[date_created] => WC_DateTime Object(
[utc_offset:protected] => 0
[date] => 2019-02-07 06:41:05.000000
[timezone_type] => 1
[timezone] => +00:00
)
[date_modified] => WC_DateTime Object(
[utc_offset:protected] => 0
[date] => 2019-02-07 06:41:05.000000
[timezone_type] => 1
[timezone] => +00:00
)
[status] => publish
[featured] =>
[catalog_visibility] => visible
[description] => Starts: Cairns QLD, Australia<br/>Ends: Cairns QLD, Australia<br/><br/><p>Cairns Dive Centre offers you the best value for money diving and snorkelling day trip out to the Outer Great Barrier Reef. The Sun-Kist departs daily from “E” Gate at the Marlin Marina, travels via Fitzroy Island, on the way to our live aboard boat. Sunkist will stay aside the Kangaroo Explorer and will visit one dive/snorkel location daily from a choice of Milln, Briggs, Moore and Thetford Reefs, Outer Great Barrier Reefs approximately 65 –70 kilometres from the coast of Cairns. Our outer reef sites are chosen for their abundance of hard and soft corals, amazing marine life, their diversity, splendour and visibility. The site chosen on the day will always offer the best in terms of safety and passenger comfort. Sun-Kist is a state of the art 60 foot (18 metre) mono hull with a top speed of 18 knots, which can carry 48 divers, however for extra comfort Cairns Dive Centre limits the combined diving and snorkelling passenger numbers to a maximum of 20 for our day trip to the Outer Great Barrier Reef.</p> <p>Optional Introductory dives are available on request for AUD 50 (first dive) and AUD 40 (second dive) payable on board.</p> <p>Includes morning tea or coffee, lunch, afternoon tea and use of all the snorkel equipment.</p> <p><strong>Trip Itinerary</strong></p> <ul> <li>7:00am: Meet at Gate 'E' Finger, Marlin Marina, for departure</li> <li>7:30am: Transfer to our liveaboard boat, which is moored on the outer Great Barrier Reef, via Fitzroy Island</li> <li>9:45am: Arrive at first reef site</li> <li>10:00am: First snorkel session</li> <li>12 noon: Lunch</li> <li>12:30pm: Second snorkel session</li> <li>2:45pm: Depart for Cairns, via Fitzroy Island</li> </ul> <p>Please note: For the comfort, pleasure and safety of all passengers and crew all schedules, reef sites and number of dive sessions are planned on the day, subject to weather and other conditions by the Master of the Vessel.</p>
[short_description] => Our Outer Great Barrier Reef sites are chosen for their abundance of hard and soft corals, amazing marine life and their diversity, splendor and visibility.
Departing daily from the Marlin Marina, M.V. Sun-Kist travels via Fitzroy Island on the way to the true Outer Great Barrier Reef. <br> <br>Book now to receive flexible, open-dated tickets, or <a href="/contact">contact us</a> if you want to travel on a specific date.
[sku] => 18326
[price] => 110.00
[regular_price] => 120.00
[sale_price] => 110.00
[date_on_sale_from] =>
[date_on_sale_to] =>
[total_sales] => 0
[tax_status] => none
[tax_class] =>
[manage_stock] =>
[stock_quantity] =>
[stock_status] => instock
[backorders] => no
[low_stock_amount] =>
[sold_individually] => 1
[weight] =>
[length] =>
[width] =>
[height] =>
[upsell_ids] => Array()
[cross_sell_ids] => Array()
[parent_id] => 0
[reviews_allowed] => 1
[purchase_note] =>
[attributes] => Array()
[default_attributes] => Array()
[menu_order] => 0
[post_password] =>
[virtual] =>
[downloadable] =>
[category_ids] => Array(
[0] => 1251
)
[tag_ids] => Array(
[0] => 18
[1] => 24
[2] => 153
[3] => 154
[4] => 166
[5] => 289
[6] => 290
[7] => 291
[8] => 292
)
[shipping_class_id] => 0
[downloads] => Array()
[image_id] => 57318
[gallery_image_ids] => Array(
[0] => 57319
[1] => 57320
[2] => 57321
[3] => 57322
[4] => 57323
[5] => 57324
[6] => 57325
[7] => 57326
[8] => 57327
[9] => 57328
[10] => 57329
[11] => 57330
[12] => 57331
[13] => 57332
[14] => 57333
)
[download_limit] => -1
[download_expiry] => -1
[rating_counts] => Array()
[average_rating] => 0
[review_count] => 0
)
[supports:protected] => Array(
[0] => ajax_add_to_cart
)
[id:protected] => 57317
[changes:protected] => Array()
[object_read:protected] => 1
[extra_data:protected] => Array()
[default_data:protected] => Array(
[name] =>
[slug] =>
[date_created] =>
[date_modified] =>
[status] =>
[featured] =>
[catalog_visibility] => visible
[description] =>
[short_description] =>
[sku] =>
[price] =>
[regular_price] =>
[sale_price] =>
[date_on_sale_from] =>
[date_on_sale_to] =>
[total_sales] => 0
[tax_status] => taxable
[tax_class] =>
[manage_stock] =>
[stock_quantity] =>
[stock_status] => instock
[backorders] => no
[low_stock_amount] =>
[sold_individually] =>
[weight] =>
[length] =>
[width] =>
[height] =>
[upsell_ids] => Array()
[cross_sell_ids] => Array()
[parent_id] => 0
[reviews_allowed] => 1
[purchase_note] =>
[attributes] => Array()
[default_attributes] => Array()
[menu_order] => 0
[post_password] =>
[virtual] =>
[downloadable] =>
[category_ids] => Array()
[tag_ids] => Array()
[shipping_class_id] => 0
[downloads] => Array()
[image_id] =>
[gallery_image_ids] => Array()
[download_limit] => -1
[download_expiry] => -1
[rating_counts] => Array()
[average_rating] => 0
[review_count] => 0
)
[data_store:protected] => WC_Data_Store Object(
[instance:WC_Data_Store:private] => WC_Product_Data_Store_CPT Object(
[internal_meta_keys:protected] => Array(
[0] => _visibility
[1] => _sku
[2] => _price
[3] => _regular_price
[4] => _sale_price
[5] => _sale_price_dates_from
[6] => _sale_price_dates_to
[7] => total_sales
[8] => _tax_status
[9] => _tax_class
[10] => _manage_stock
[11] => _stock
[12] => _stock_status
[13] => _backorders
[14] => _low_stock_amount
[15] => _sold_individually
[16] => _weight
[17] => _length
[18] => _width
[19] => _height
[20] => _upsell_ids
[21] => _crosssell_ids
[22] => _purchase_note
[23] => _default_attributes
[24] => _product_attributes
[25] => _virtual
[26] => _downloadable
[27] => _download_limit
[28] => _download_expiry
[29] => _featured
[30] => _downloadable_files
[31] => _wc_rating_count
[32] => _wc_average_rating
[33] => _wc_review_count
[34] => _variation_description
[35] => _thumbnail_id
[36] => _file_paths
[37] => _product_image_gallery
[38] => _product_version
[39] => _wp_old_slug
[40] => _edit_last
[41] => _edit_lock
)
[must_exist_meta_keys:protected] => Array(
[0] => _tax_class
)
[extra_data_saved:protected] =>
[updated_props:protected] => Array()
[meta_type:protected] => post
[object_id_field_for_meta:protected] =>
)
[stores:WC_Data_Store:private] => Array(
[coupon] => WC_Coupon_Data_Store_CPT
[customer] => WC_Customer_Data_Store
[customer-download] => WC_Customer_Download_Data_Store
[customer-download-log] => WC_Customer_Download_Log_Data_Store
[customer-session] => WC_Customer_Data_Store_Session
[order] => WC_Order_Data_Store_CPT
[order-refund] => WC_Order_Refund_Data_Store_CPT
[order-item] => WC_Order_Item_Data_Store
[order-item-coupon] => WC_Order_Item_Coupon_Data_Store
[order-item-fee] => WC_Order_Item_Fee_Data_Store
[order-item-product] => WC_Order_Item_Product_Data_Store
[order-item-shipping] => WC_Order_Item_Shipping_Data_Store
[order-item-tax] => WC_Order_Item_Tax_Data_Store
[payment-token] => WC_Payment_Token_Data_Store
[product] => WC_Product_Data_Store_CPT
[product-grouped] => WC_Product_Grouped_Data_Store_CPT
[product-variable] => WC_Product_Variable_Data_Store_CPT
[product-variation] => WC_Product_Variation_Data_Store_CPT
[shipping-zone] => WC_Shipping_Zone_Data_Store
[webhook] => WC_Webhook_Data_Store
[report-revenue-stats] => Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore
[report-orders] => Automattic\WooCommerce\Admin\API\Reports\Orders\DataStore
[report-orders-stats] => Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore
[report-products] => Automattic\WooCommerce\Admin\API\Reports\Products\DataStore
[report-variations] => Automattic\WooCommerce\Admin\API\Reports\Variations\DataStore
[report-products-stats] => Automattic\WooCommerce\Admin\API\Reports\Products\Stats\DataStore
[report-categories] => Automattic\WooCommerce\Admin\API\Reports\Categories\DataStore
[report-taxes] => Automattic\WooCommerce\Admin\API\Reports\Taxes\DataStore
[report-taxes-stats] => Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats\DataStore
[report-coupons] => Automattic\WooCommerce\Admin\API\Reports\Coupons\DataStore
[report-coupons-stats] => Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats\DataStore
[report-downloads] => Automattic\WooCommerce\Admin\API\Reports\Downloads\DataStore
[report-downloads-stats] => Automattic\WooCommerce\Admin\API\Reports\Downloads\Stats\DataStore
[admin-note] => Automattic\WooCommerce\Admin\Notes\DataStore
[report-customers] => Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore
[report-customers-stats] => Automattic\WooCommerce\Admin\API\Reports\Customers\Stats\DataStore
[report-stock-stats] => Automattic\WooCommerce\Admin\API\Reports\Stock\Stats\DataStore
)
[current_class_name:WC_Data_Store:private] => WC_Product_Data_Store_CPT
[object_type:WC_Data_Store:private] => product-simple
)
[meta_data:protected] =>
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment