This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
{ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "blogwerk/oop-project", | |
"type": "project", | |
"authors": [ | |
{ | |
"name": "Michael Sebel", | |
"email": "[email protected]" | |
}, |