Comments (3)
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.
from woocommerce.
is it possible to create order with the same method?
from woocommerce.
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.
from woocommerce.
Related Issues (20)
- How do I find out what orders belong to a user? HOT 3
- Create README with basic documentation
- Create PHPUnit tests
- Should this be BaseCollection or Collection? HOT 3
- Could not parse '1604067041' HOT 4
- Creating a Product Category HOT 6
- exception while saving Meta Data HOT 4
- product lookup table HOT 1
- Allow for PHP 8 please :) HOT 2
- Laravel 9.x support
- It is completed? HOT 1
- Not possible to make a post request, its only for consuming data ? HOT 1
- Filter products by category HOT 1
- Variable product HOT 1
- Product::items relationship does not work with doesntHave
- Trait 'Corcel\Traits\AliasesTrait' not found HOT 1
- OrderBuilder not found HOT 2
- Not Compatible with corcel 4.0, HOT 1
- Is this done now? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from woocommerce.