Skip to content

Instantly share code, notes, and snippets.

{
"name": "blogwerk/oop-project",
"type": "project",
"authors": [
{
"name": "Michael Sebel",
"email": "[email protected]"
},
<?php
// Create the manual order
$order = new WooCommerce_ManualOrder();
// Initialize the order with the currently logged in user
$order->initializeOrder($userId);
// Set error pages
$order->setErrorPages(
get_permalink() . '?view=showError&type=no-stock', // if a product is not available in stock
get_permalink() . '?view=showError&type=order-error' // if there's a creating error on the order
);
<?php
/**
* This can be used to manually create a simple order. You can add products and some
* configurations and error pages if anything fails. This will not do an actual checkout
* and can be used to create apps that are used by cashiers.
* @author Michael Sebel <[email protected]>
*/
class WooCommerce_ManualOrder
{
/**