Skip to content

Instantly share code, notes, and snippets.

View kappuccino's full-sized avatar

Benjamin Mosnier kappuccino

View GitHub Profile
@kappuccino
kappuccino / woocommerce-custom-cart-item-data.php
Created June 13, 2016 13:47 — forked from RadGH/woocommerce-custom-cart-item-data.php
Get and set custom cart item/product information prior to WooCommerce checkout, and carry those valus over to Order Item Metadata.
<?php
/*
Instructions:
1) Save data when adding to cart
When adding an item to your cart, use ld_woo_set_item_data. The best action for this to occur is
"woocommerce_add_to_cart". The first parameter for this action contains the "cart_item_key",
which is required for the function.