connect($i); } } return false; } /** * Render the checkout aside and append to actions. * * Hooked via: add_filter('jvbAdditionalActions', [Checkout::class, 'render']) */ public static function render(array $actions): array { if (is_singular(BASE . 'dash') || is_post_type_archive(BASE . 'dash')) { return $actions; } $provider = self::getProvider(); if (!$provider || !$provider->isSetUp()) { return $actions; } $providerName = strtolower($provider->getServiceName()); $aside = ''; $aside .= self::templates($providerName); $actions[] = [ 'button' => self::toggleButton(), 'content' => $aside, ]; return $actions; } /***************************************************************** * SECTIONS *****************************************************************/ /** * Checkout tab content: customer info + payment container */ private static function checkoutContent(string $provider): string { $name = $email = $phone = ''; if (is_user_logged_in()) { $meta = Meta::forUser(get_current_user_id()); if ($meta) { $name = $meta->get('display_name'); $email = $meta->get('user_email'); $phone = $meta->get('phone'); } } $form = sprintf( '
'; return $form; } /** * Cart items tab: table + account details */ private static function cartContent(string $provider): string { $content = sprintf(''; return $content; } /** * Order confirmation / status tracking */ private static function orderStatus(): string { $statuses = apply_filters('jvb_checkout_order_statuses', [ 'received' => 'Order Received', 'preparing' => 'Preparing', 'ready' => 'Ready for Pickup', ]); ob_start(); ?>Order #
We\'ve restored your cart from your last session below.
If you\'d rather start over, click the button below.
No items in cart.
You can ' . $browseText . ' to order.