Giter Site home page Giter Site logo

Able to Create New Contents about woocommerce HOT 3 OPEN

corcel avatar corcel commented on June 2, 2024
Able to Create New Contents

from woocommerce.

Comments (3)

Dartui avatar Dartui commented on June 2, 2024

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.

xuark avatar xuark commented on June 2, 2024

is it possible to create order with the same method?

from woocommerce.

Stevemoretz avatar Stevemoretz commented on June 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.