Skip to content

Instantly share code, notes, and snippets.

@ajgagnon
Created February 8, 2023 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajgagnon/6f8eb7f7c844c55f5860a7370eb60cde to your computer and use it in GitHub Desktop.
Save ajgagnon/6f8eb7f7c844c55f5860a7370eb60cde to your computer and use it in GitHub Desktop.
<?php
add_action("surecart/order_created", function( $order ) {
$checkout = \SureCart\Models\Checkout::with([
'line_items',
'line_item.price',
'line_item.fees',
'price.product',
'discount',
'discount.promotion',
'shipping_address',
])->find( $order->checkout );
// do something with the checkout.
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment