dcolumbus
dcolumbus

Reputation: 9722

WooCommerce, manually add a product and price for purchase

I'm trying to figure out if there's a way to use the WooCommerce Cart and Checkout functionality if I need to purchase something that isn't technically a product

In other words, it's a completely independent "membership" that needs to be purchased, but isn't a product post.

I'd love to be able to add an item in the cart manually ... manual name, manual price, manual meta data and then purchase.

Does anyone have any idea how to do this?

Upvotes: 3

Views: 2714

Answers (1)

VitVad
VitVad

Reputation: 336

here is example

global $woocommerce;
$woocommerce->cart->add_to_cart(16);

16 -> this is ID of existing product in store

documentation Link

Upvotes: 2

Related Questions