dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
checkout_en.fd.php
Go to the documentation of this file.
1<?php
2$messages = array();
3$messages['save_success'] = 'Data was saved';
4$messages['save_succeass'] = $messages['save_success'];
5$messages['save_error'] = 'Data could not be saved';
6$messages['page_title'] = 'Checkout';
7$messages['bar_title'] = 'Complete order';
8$messages['page_subtitle'] = 'Review the customer details and test the demo order process.';
9$messages['empty_title'] = 'Your cart is empty';
10$messages['empty_subtitle'] = 'Select items before proceeding to checkout.';
11$messages['empty_message'] = 'Select an item in the catalog and add it to your cart.';
12$messages['login_subtitle'] = 'Sign-in required.';
13$messages['login_message'] = '<strong>Sign-in required.</strong><br>Guest orders are currently disabled. Please sign in before completing the order.';
14$messages['form_info'] = 'Review the customer details, payment method and acceptance of the legal texts.';
15$messages['validation_error'] = 'Please check the highlighted required fields.';
16$messages['no_payment'] = 'No payment method is available.';
17$messages['select_payment'] = 'Select an available payment method.';
18$messages['confirm_legal'] = 'Please accept the legal texts and acknowledge the withdrawal policy.';
19$messages['legal_field_error'] = 'Please accept the legal texts.';
20$messages['withdrawal_field_error'] = 'Please acknowledge the withdrawal policy.';
21$messages['order_error'] = 'The order could not be created.';
22$messages['technical_error'] = 'The order could not be processed due to a technical error.';
23$messages['demo_title'] = 'Demo shop – no actual purchase';
24$messages['demo_message'] = 'This shop is provided solely for demonstration and testing. You can complete the entire order process with test data; only a technical test transaction is processed. No actual purchase, payment or delivery takes place, and no purchase contract is formed.';
25$messages['payment_bank_transfer'] = 'Prepayment / bank transfer';
26$messages['payment_invoice'] = 'Invoice';
27$messages['payment_none_help'] = 'No payment method is currently active or fully configured.';
28$messages['payment_bank_transfer_help'] = 'The order is saved. The customer then transfers the amount using the order number as the payment reference.';
29$messages['payment_invoice_help'] = 'The order is saved and paid later by invoice.';
30$messages['payment_paypal_help'] = 'You will be redirected to PayPal. The payment is updated automatically after approval.';
31$messages['payment_amazon_help'] = 'You will be redirected to Amazon Pay. Sandbox and live mode use the credentials saved in the shop settings.';
32$messages['bank_transfer_default'] = 'Please transfer the invoice amount and include the order number.';
33$messages['invoice_default'] = 'You will receive an invoice. Please pay within the stated period.';
34$messages['paypal_default'] = 'The payment is authorized through PayPal and updated automatically after a successful response.';
35$messages['amazon_default'] = 'The payment is authorized through Amazon Pay and updated automatically after a successful response.';
36$messages['account_owner'] = 'Account holder';
37$messages['purpose'] = 'Payment reference';
38$messages['column_product'] = 'Product';
39$messages['column_quantity'] = 'Quantity';
40$messages['column_price'] = 'Price';
41$messages['column_shipping'] = 'Shipping';
42$messages['column_total'] = 'Total';
43$messages['amount_due'] = 'Amount due';
44$messages['order_saved_title'] = 'Order saved';
45$messages['order_number_text'] = 'Your order number is';
46$messages['payment_method_label'] = 'Payment method';
47$messages['status_label'] = 'Status';
48$messages['order_waiting'] = 'The order is visible in shop administration and is awaiting processing.';
49$messages['total_label'] = 'Total';
50$messages['view_orders'] = 'View orders';
51$messages['continue_shopping'] = 'Continue shopping';
52$messages['thanks_title'] = 'Thank you';
53$messages['saved_snapshot_subtitle'] = 'The order was saved as a snapshot.';
54$messages['payment_note'] = 'Payment information';
55
56$addField = function($name, $type, $label, $rules, $tpl, $extra = array()) use (&$fields) {
57 $field=array();
58 $field['name']=$name;
59 $field['type']=$type;
60 $field['index']='';
61 $field['length']=$extra['length'] ?? '';
62 $field['default']=$extra['default'] ?? '';
63 $field['label']=$label;
64 $field['rules']=$rules;
65 $field['tooltip']=$extra['tooltip'] ?? '';
66 $field['errormsg']=$extra['errormsg'] ?? '';
67 $field['placeholder']=$extra['placeholder'] ?? '';
68 $field['convert']='';
69 $field['protect']='0';
70 $field['mask']='';
71 $field['data']=$extra['data'] ?? '';
72 $field['options']=$extra['options'] ?? '';
73 $field['tpl']=$tpl;
75};
76
77$addField('customer_name','varchar','Name','*|min=2|max=180','text-label',array('placeholder'=>'Your name'));
78$addField('customer_email','varchar','E-mail','email|max=180','text-label',array('placeholder'=>'name@example.org'));
79$addField('customer_phone','varchar','Telephone','*|max=80','text-label',array('placeholder'=>'+49 30 123456'));
80$addField('shipping_address','mediumtext','Shipping address','*|min=8|max=2000','textarea-label',array('data'=>'rows=4','placeholder'=>"Name\nStreet and house number\nPostal code and city\nCountry"));
81$addField('note','mediumtext','Note','*|max=2000','textarea-label',array('data'=>'rows=4','placeholder'=>'Optional note on ordering'));
82$addField('checkout_request_id','varchar','','parameter|max=64','hidden');
83
84$cfg = array();
85if (function_exists('dbx')) {
86 $rawCfg = dbx()->get_config('dbxShop');
87 $cfg = is_array($rawCfg) ? $rawCfg : array();
88}
89$cfgBool = function(string $key, bool $default = false) use ($cfg): bool {
90 if (!array_key_exists($key, $cfg)) {
91 return $default;
92 }
93 $value = $cfg[$key];
94 if (is_bool($value)) return $value;
95 return in_array(strtolower(trim((string)$value)), array('1', 'true', 'yes', 'on'), true);
96};
98if ($cfgBool('payment_bank_transfer_enabled', true)) {
99 $paymentOptions['bank_transfer'] = 'Prepayment / bank transfer';
100}
101if ($cfgBool('payment_invoice_enabled', false)) {
102 $paymentOptions['invoice'] = 'Invoice';
103}
104if (
105 $cfgBool('payment_paypal_enabled', false)
106 && trim((string)($cfg['payment_paypal_client_id'] ?? '')) !== ''
107 && trim((string)($cfg['payment_paypal_client_secret'] ?? '')) !== ''
108) {
109 $paymentOptions['paypal'] = 'PayPal';
110}
111if (
112 $cfgBool('payment_amazon_pay_enabled', false)
113 && trim((string)($cfg['payment_amazon_pay_merchant_id'] ?? '')) !== ''
114 && trim((string)($cfg['payment_amazon_pay_store_id'] ?? '')) !== ''
115 && trim((string)($cfg['payment_amazon_pay_public_key_id'] ?? '')) !== ''
116 && trim((string)($cfg['payment_amazon_pay_private_key'] ?? '')) !== ''
117) {
118 $paymentOptions['amazon_pay'] = 'Amazon Pay';
119}
121foreach ($paymentOptions as $value => $label) {
122 $optionString .= ($optionString !== '' ? '&' : '') . $value . '=' . $label;
123}
124$addField('payment_method','varchar','Payment method','parameter','select-single-label',array('options'=>$optionString,'default'=>array_key_first($paymentOptions) ?: ''));
125$addField('accept_legal','int','I have read and accept the <a href="?dbx_modul=dbxShop&amp;dbx_run1=legal" target="_blank" rel="noopener">legal texts, terms and conditions, and payment and shipping information</a>.','int','dbxShop|shop-checkout-check');
126$addField('accept_withdrawal','int','I have read the <a href="?dbx_modul=dbxShop&amp;dbx_run1=withdrawal" target="_blank" rel="noopener">withdrawal policy</a>.','int','dbxShop|shop-checkout-check');
127?>
if(function_exists('dbx')) $cfgBool
$paymentOptions
if( $cfgBool( 'payment_bank_transfer_enabled', true)) if($cfgBool('payment_invoice_enabled', false)) if($cfgBool( 'payment_paypal_enabled', false) &&trim((string)( $cfg[ 'payment_paypal_client_id'] ?? '')) !=='' &&trim((string)( $cfg[ 'payment_paypal_client_secret'] ?? '')) !=='') if( $cfgBool('payment_amazon_pay_enabled', false) &&trim((string)($cfg['payment_amazon_pay_merchant_id'] ?? '')) !=='' &&trim((string)($cfg['payment_amazon_pay_store_id'] ?? '')) !=='' &&trim((string)($cfg['payment_amazon_pay_public_key_id'] ?? '')) !=='' &&trim((string)($cfg['payment_amazon_pay_private_key'] ?? '')) !=='') $optionString
$cfg
if(function_exists('dbx')) $cfgBool
$addField
$messages
Definition config.fd.php:2
if($web->content_permalink_redirect_target() !=='') $tpl
DBX schema administration.