woocommerce
woocommerce copied to clipboard
Able to Create New Contents
Is it possible to create new contents (Post, Products, Upload Images) with this extension of corcel?
It is possible even without this package, but it's not easy thing. You need to know product meta keys and you can create it in this way:
$product = Product::create([
'post_title' => 'Product name',
'post_content' => 'Post description',
'post_status' => 'publish',
// other wp_posts table columns...
);
$product->createMeta([
'_sku' => 'some-sku',
'_regular_price' => '10.00',
'_sale_price' => '5.00',
'_thumbnail_id' => 10,
// other wp_postmeta product meta values...
]);
I will think about making this process at least a bit easier.
is it possible to create order with the same method?
is it possible to create order with the same method?
Came here for the same reason, even though technically it's possible cause order is just a custom post type but order items are stored in a different table, and there are several other tables for the orders so if not already built in, which is not. It's not as easy as just create the order and update the metas.
You should change all the other tables (first have to know how all that works)
For these I usually use a webhook from php (laravel, lumeon,... pointing to a wp rest custom endpoint) and let the job be done on side of WordPress.
That way everything would work even if you use wpml which I do.