cart = $cart; $this->config = $config; $this->requireShipping = $cart->requireShipping(); $this->storeSettings = new StoreSettings(); $this->checkoutRenderer = new CheckoutRenderer($cart); $this->cartSummaryRenderer = new CartSummaryRender($cart); $this->hasSubscription = $cart->hasSubscription(); $this->customer = CustomerResource::getCurrentCustomer(); $this->productMeta = ProductMeta::query()->where('object_id', Arr::get($this->cart->cart_data, '0.post_id'))->where('meta_key', 'license_settings')->first(); $variations = $this->productMeta->meta_value['variations'] ?? []; $cartItem = $this->cart->cart_data[0] ?? []; $objectId = $cartItem['object_id'] ?? null; $this->matchedVariation = $objectId && isset($variations[$objectId]) ? $variations[$objectId] : null; } public function getFragment($fragmentName) { $maps = [ 'payment_methods' => 'renderPaymentMethods', 'summary_group' => 'renderSummaryGroup' ]; if(isset($maps[$fragmentName])) { ob_start(); $this->{$maps[$fragmentName]}(); return ob_get_clean(); } return ''; } public function render() { ?>
renderCheckoutDetails(); ?> renderCheckoutBilling(); ?>
renderCheckoutSummary();?> checkoutRenderer->renderAddressFields(); ?>
checkoutRenderer->renderShippingOptions(); ?>
$this->cart]); ?> checkoutRenderer->agreeTerms(); ?> renderSummaryGroup(); ?> renderCheckoutReviews();?>
cart->cart_data, '0.title', ''); $postTitle = Arr::get($this->cart->cart_data, '0.post_title', ''); $subTotal = Helper::toDecimal(Arr::get($this->cart->cart_data, '0.subtotal', 0)); $media = Arr::get($this->cart->cart_data, '0.featured_media', ''); ?>
<?php echo esc_attr($postTitle);?>

-

renderPaymentTypeInfo(); ?> matchedVariation) :?>
matchedVariation, 'activation_limit'); if (empty($limit) || (int) $limit === 0) { echo esc_html__('Unlimited Activation', 'fluent-cart'); } else { echo esc_html(sprintf(__('Activation limit %d', 'fluent-cart'), $limit)); } ?>
cart->cart_data, '0.other_info', []); $paymentType = Arr::get($otherInfo, 'payment_type', ''); $itemPrice = Arr::get($this->cart->cart_data, '0.unit_price', 0); if ($paymentType === 'subscription') { $subscriptionInfo = Helper::generateSubscriptionInfo($otherInfo, $itemPrice); $setupFeeInfo = Helper::generateSetupFeeInfo($otherInfo); $trialInfo = Helper::generateTrialInfo($otherInfo); ?>
true]); ?>, ,
cartSummaryRenderer->renderItemsFooter(); ?>
cart->getDiscountLines(); if (!$discounts) { return; } ?>
$discount_data): ?>
–
I got the annual unlimited websites premium version and I'm upgrading to the Lifetime Unlimited Websites plan real soon. Building WordPress website
Bryson Suleiman, Founder and WordPress Expert at Webbryson
customer->first_name ?? '') . ' ' . ($this->customer->last_name ?? '') ); if (!$fullName && $user) { $fullName = $user->display_name; } $fieldsSchema = CheckoutFieldsSchema::getFieldsSettings(); $fullNameField = Arr::get($fieldsSchema, 'basic_info.full_name', []); $emailField = Arr::get($fieldsSchema, 'basic_info.email', []); $isRequiredFullName = Arr::get($fullNameField, 'required', 'no') === 'yes' ? 'yes' : ''; $isRequiredEmail = Arr::get($emailField, 'required', 'no') === 'yes' ? 'yes' : ''; ?>
renderField([ 'label' => esc_attr__('Full name', 'fluent-cart') . ($isRequiredFullName ? ' *' : ''), 'id' => 'billing_full_name', 'type' => 'text', 'placeholder' => __('Jon Doe', 'fluent-cart'), 'name' => 'billing_full_name', 'autocomplete' => 'given-name', 'aria-label' => esc_attr__('Full name', 'fluent-cart'), 'required' => $isRequiredFullName, 'value' => $fullName ]); ?>
renderField([ 'label' => esc_attr__('Email address', 'fluent-cart') . ($isRequiredEmail ? ' *' : ''), 'id' => 'billing_email', 'type' => 'text', 'placeholder' => 'jon.doe@example.com', 'name' => 'billing_email', 'autocomplete' => 'email', 'required' => $isRequiredEmail, 'aria-label' => esc_attr__('Email address', 'fluent-cart'), 'value' => $this->customer->email ?? $user->user_email, 'disabled' => (bool)($this->customer->email ?? $user->user_email) ]); ?>
renderField([ // 'label' => __('Last name', 'fluent-cart'), // 'id' => 'billing_last_name', // 'type' => 'text', // 'placeholder' => __('Doe', 'fluent-cart'), // 'name' => 'billing_last_name', // 'autocomplete' => 'given-name', // 'required' => true, // 'value' => $this->customer->last_name ?? '' // ]); // ?>
checkoutRenderer->renderCreateAccountField(); ?>

renderPaymentMethods(); ?>
cart))->renderCheckoutButton(); ?>
cart->getEstimatedTotal() <= 0) { if (!$this->cart->hasSubscription() || $this->cart->getEstimatedRecurringTotal() <= 0) { return ''; } } $selectedPaymentMethod = Arr::get($this->cart->checkout_data, 'form_data._fct_pay_method', ''); $activePaymentMethods = PaymentMethods::getActiveMethodInstance($this->cart); $activePaymentMethods = apply_filters('fluent_cart/checkout_active_payment_methods', $activePaymentMethods, [ 'cart' => $this->cart ]); // filter the active payment methods to only include the selected payment method $selectedModalPaymentMethod = apply_filters('fluent_cart/modal_checkout/filter_active_payment_methods', []); if (!empty($selectedModalPaymentMethod)) { $activePaymentMethods = array_filter($activePaymentMethods, function ($method) use ($selectedModalPaymentMethod) { return in_array($method->getMeta('route'), $selectedModalPaymentMethod); }); } if (!$selectedPaymentMethod && !empty($activePaymentMethods)) { $selectedPaymentMethod = $activePaymentMethods[0] ? $activePaymentMethods[0]->getMeta('route') : ''; } $checkoutMethodStyle = $this->storeSettings->get('checkout_method_style', 'logo'); ?>
getMeta('route')); $this->renderPaymentMethod($method, [ 'selected_id' => $selectedPaymentMethod, 'style' => $checkoutMethodStyle, 'aria_checked' => $isSelected ? 'true' : 'false', 'role' => 'radio' ]); } ?> ' . esc_html__('Activate from settings.', 'fluent-cart') . ''; } echo '
' . wp_kses_post($emptyText) . '
'; ?>
renderPaymentMethodContent($method, [ 'style' => $checkoutMethodStyle ]); } ?>
getMeta('route'); $methodTitle = $method->getMeta('title'); $methodStyle = Arr::get($config, 'style', 'logo'); $inputAttributes = array_filter([ 'class' => 'form-radio-input', 'type' => 'radio', 'name' => '_fct_pay_method', 'id' => 'fluent_cart_payment_method_' . $route, 'value' => $route, 'required' => true, 'checked' => $route === Arr::get($config, 'selected_id', '') ? 'true' : '', 'role' => Arr::get($config, 'role', 'radio'), 'aria-checked' => Arr::get($config, 'aria_checked', 'false'), ]); $wrapperClass = $methodStyle === 'logo' ? 'fct_payment_method_logo' : 'fct_payment_method'; $wrapperAttributes = [ 'class' => $wrapperClass . ' ' . 'fct_payment_method_wrapper fct_payment_method_' . $route, 'tabindex' => '0', 'role' => 'presentation' ]; ?>
> />
getMeta('route'); $methodTitle = $method->getMeta('title'); $methodStyle = Arr::get($config, 'style', 'logo'); $pmContext = [ 'route' => $route, 'method_title' => $methodTitle, 'method_style' => $methodStyle, ]; $paymentMethodClass = apply_filters_deprecated('fluent_cart_payment_method_list_class', ['', $pmContext], '1.3.16', 'fluent_cart/payment_method_list_class', 'Use fluent_cart/payment_method_list_class instead of fluent_cart_payment_method_list_class.'); $paymentMethodClass = apply_filters('fluent_cart/payment_method_list_class', $paymentMethodClass, $pmContext); ?>
getMeta('instructions')): ?>
getMeta('instructions')); ?>
" aria-hidden="true"> $method, 'cart' => $this->cart, 'route' => $route ] ); ?>