save()
18th January 2021
0 Comments
Framework / CMS
WooCommerce [Version: Since 3.0.0]
Syntax
Typical Usage
Saves or updates WooCommerce orders, products and other objects.
Accepted Parameters
none.
Return Value(s)
Returns the item’s ID.Examples of save()
Example 1
<?php
$user_id = get_current_user_id();
$args = array(
'customer_id' => $user_id
);
$new_order = wc_create_order($args);
$new_order->save();
Used In Projects
Was This Helpful?
If this post has helped you, please let me know. Your feedback will be highly appreciated and will help me build better content.