config = $config;
$this->is_first_time = Arr::get($this->config, 'is_first_time', false);
$this->order_operation = Arr::get($this->config, 'order_operation', false);
$this->settings = new StoreSettings();
AssetLoader::enqueueThankYouPageAssets();
}
public function renderWrapperStart()
{
?>
config, 'order', null);
if (!$order) {
return;
}
?>
renderWrapperStart();
} ?>
config); ?>
renderHeader(); ?>
config); ?>
config); ?>
renderBody(); ?>
config); ?>
renderWrapperEnd();
} ?>
renderFooter();
do_action('fluent_cart/after_receipt', [
'order' => $order,
'is_first_time' => $this->is_first_time ?? false,
'order_operation' => $this->order_operation ?? null
]);
if (!empty($this->is_first_time)) {
do_action('fluent_cart/after_receipt_first_time', [
'order' => $order,
'order_operation' => $this->order_operation ?? null
]);
}
}
public function renderHeader()
{
$bgColor = '#d4edda';
$titleColor = '#155724';
$iconBg = '#155724bd';
$order = Arr::get($this->config, 'order', null);
if ($order->payment_status !== 'paid') {
$bgColor = '#fff3cd';
$titleColor = '#856404';
$iconBg = '#856404bd';
}
?>
config, 'order', null);
if (!$order) {
return;
}
?>
config); ?>
renderOrderHeader(); ?>
config); ?>
renderStoreTaxInformation(); ?>
config); ?>
renderOrderItems(); ?>
config); ?>
renderSubscriptionItems(); ?>
renderDownloads(); ?>
renderLicenses(); ?>
renderAddress(); ?>
renderThankYouPageInstructions(); ?>
config, 'order', null);
$profilePage = $this->settings->getCustomerProfilePage();
?>
customer->full_name)
);
?>
payment_status === 'paid') : ?>
#%s%s',
esc_html__('Your order ', 'fluent-cart'),
esc_url($profilePage . 'order/' . $order->uuid),
esc_html($order->invoice_no),
esc_html__(' has been placed successfully.', 'fluent-cart')
);
?>
%s %s %s.',
esc_url($profilePage . 'order/' . $order->uuid),
esc_html__('Your order', 'fluent-cart'),
esc_html__('has payment due. You can pay from', 'fluent-cart'),
esc_url(\FluentCart\App\Services\Payments\PaymentHelper::getCustomPaymentLink($order->uuid)),
esc_html__('here', 'fluent-cart')
);
?>
config, 'order', null);
$orderTaxRates = $order->orderTaxRates->first();
if ($order->tax_total > 0 || $orderTaxRates): ?>
meta, 'store_vat_number', '');
$taxcountry = Arr::get($orderTaxRates->meta ?? [], 'tax_country', '');
if ($storeVatNumber !== '') {
echo '
' . esc_html(TaxModule::getCountryTaxTitle($taxcountry)) . ': ' . esc_html($storeVatNumber) . '
';
}
}
?>
config, 'order', null);
if ($order->order_items) : ?>
renderOrderItemsHeader(); ?>
renderOrderItemsBody(); ?>
config, 'order', null);
?>
getProductItems()->toArray();
$orderItems = $this->buildBundleItemsTree($orderItems);
foreach ($orderItems as $item) :
?>
1): ?>
x
-
renderBundleProducts($item); ?>
renderOrderTotal(); ?>
renderTaxNote(); ?>
config, 'order', null);
if (!$order) {
return;
}
$transaction = $order->getLatestTransaction();
if ($transaction && !empty($transaction->payment_method)) {
$methodSlug = $transaction->payment_method;
}
if (GatewayManager::has($methodSlug)) {
$gatewayInstance = GatewayManager::getInstance($methodSlug);
if ($gatewayInstance && isset($gatewayInstance->settings)) {
$gatewaySettings = (array) $gatewayInstance->settings->get();
$thankYouPageInstructions = Arr::get($gatewaySettings, 'thank_you_page_instructions', '');
}
}
if (!empty($thankYouPageInstructions)) : ?>
renderSubtotal(); ?>
renderDiscount(); ?>
renderShipping(); ?>
renderFees(); ?>
renderTaxTotal(); ?>
renderShippingTax(); ?>
renderRefund(); ?>
renderTotal(); ?>
renderPaymentMethod(); ?>
config, 'order', null);
$taxtotal = $order->tax_total + $order->shipping_tax;
if (Arr::get($orderTaxRates->meta ?? [], 'vat_reverse.valid') && !$taxtotal): ?>
config, 'order', null);
if ($order->subtotal != $order->total_amount || $order->tax_total > 0): ?>
config, 'order', null);
if ($order->manual_discount_total + $order->coupon_discount_total > 0): ?>
- manual_discount_total + $order->coupon_discount_total)); ?>
config, 'order', null);
if ($order->shipping_total > 0): ?>
config, 'order', null);
if (!$order || $order->fee_total <= 0) {
return;
}
$feeItems = $order->feeItems()->get();
foreach ($feeItems as $feeItem): ?>
title); ?>
subtotal)); ?>
config, 'order', null);
if ($order->tax_total > 0): ?>
tax_behavior == 2 ? esc_html__('(Included)', 'fluent-cart') : esc_html__('(Excluded)', 'fluent-cart'); ?>
tax_total)); ?>
config, 'order', null);
if ($order->shipping_tax > 0): ?>
tax_behavior == 2 ? esc_html__('(Included)', 'fluent-cart') : esc_html__('(Excluded)', 'fluent-cart'); ?>
shipping_tax)); ?>
config, 'order', null);
if ($order->total_refund > 0): ?>
config, 'order', null);
?>
total_amount - $order->total_refund)); ?>
config, 'order', null);
$transaction = $order->getLatestTransaction();
?>
card_last_4) :
echo esc_html($transaction->card_brand) . ' ' . esc_html($transaction->card_last_4);
else:
$title = $transaction->payment_method;
$gateway = GatewayManager::getInstance($transaction->payment_method);
$title = $gateway ? $gateway->getMeta('title') : $title;
echo esc_html($title);
endif; ?>
config, 'order', null);
$subscriptions = $order->subscriptions;
if ($subscriptions->count() == 0) {
return;
}
?>
|
item_name); ?>
|
payment_info)) : ?>
payment_info; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
next_billing_date)) : ?>
next_billing_date)->format('M d, Y h:i A')
)
);
?>
|
render('invoice.parts.subscription_items', [
// 'subscriptions' => $order->subscriptions,
// 'order' => $order
// ]);
}
public function renderDownloads()
{
$order = Arr::get($this->config, 'order', null);
$downloads = $order->getDownloads();
if (!$downloads) {
return;
}
?>
renderDownloadsNotice(); ?>
config, 'order', null);
$licenses = $order->getLicenses();
if (!$licenses || $licenses->count() == 0) {
return;
}
?>
|
productVariant->variation_title); ?>:
license_key); ?>
|
|
renderLicenseNotice(); ?>
config, 'order', null);
if ($order->fulfillment_type === 'physical') : ?>
renderBillToAddress(); ?>
renderShipToAddress(); ?>
config, 'order', null);
?>
billing_address)) :
?>
billing_address->getAddressAsText()); ?>
customer->email); ?>
customer->full_name); ?>
customer->email); ?>
billing_address->meta ?? [], 'other_data.phone', '');
if ($phoneNumber !== ''):
?>
billing_address->meta ?? [], 'other_data.company_name', '');
if ($companyName === '') {
$companyName = Arr::get($orderTaxRates->meta ?? [], 'vat_reverse.name', '');
}
echo esc_html($companyName);
?>
meta ?? [], 'vat_reverse.vat_number', '');
if ($vatNumber !== '') {
echo esc_html__('EU VAT', 'fluent-cart') . ': ' . esc_html($vatNumber);
}
?>
config, 'order', null);
?>
shipping_address)) : ?>
shipping_address->getAddressAsText()); ?>
shipping_address->meta ?? [], 'other_data.phone', '');
if ($phone !== ''):?>
customer->full_name); ?>
customer->email); ?>
config, 'order', null);
$profilePage = $this->settings->getCustomerProfilePage();
?>
config, 'order', null);
?>
$children) {
if (isset($parents[$parentId])) {
$parents[$parentId]['bundle_items'] = $children;
}
}
// Re-index a final array
return array_values($parents);
}
public function renderBundleProducts($item)
{
//dd($item);
if (!$item['bundle_items']) {
return;
}
$total = count($item['bundle_items']);
?>