Uygulamanızda, kullanıcıların ödeme alım bilgilerini yazdırmak için kullanılan tahsilat formunu ihtiyaçlarınıza göre özelleştirebilirsiniz. Aşağıdaki adımları izleyerek tahsilat formunu kolayca düzenleyebilirsiniz.
- Child Tema Oluşturma
Tahsilat formunu düzenlemeye başlamadan önce, kullandığınız aktif temanın bir child temasını oluşturmanız gerekmektedir. Child tema oluşturma işlemi, ana temada yapılan güncellemeler sırasında yaptığınız özelleştirmelerin kaybolmamasını sağlar.
- Yeni Dosya Oluşturma
Child temayı oluşturduktan sonra, child temanın altında bir gurmepos-form/collection-receipt.php dosyası oluşturmanız gerekmektedir. Örnek dosya yolu şu şekilde olmalıdır:
wp-content/themes/child-theme/gurmepos-form/collection-receipt.php
- Şablon Dosyasını Kopyalama
Şimdi, ödeme alım bilgilerinin mevcut şablon dosyasını child temaya kopyalamanız gerekiyor. Bunun için şu adımları izleyin:
-
wp-content/plugins/gurmepos-form/templates/collection-receipt.phpdosyasına gidin. -
Bu dosyanın içindeki tüm kodları kopyalayın.
-
Kopyaladığınız kodları, child tema altında oluşturduğunuz
gurmepos-form/collection-receipt.phpdosyasına yapıştırın.
- Tahsilat Formunu Özelleştirme
Artık collection-receipt.php dosyasını dilediğiniz gibi düzenleyebilirsiniz. Ödeme bilgilerini, müşteri detaylarını veya formun genel yapısını ihtiyaçlarınıza göre değiştirebilirsiniz.
<?php
/**
* Tahsilat Makbuzu
*
* @package Gurmehub
*
* @var GPOS_Transaction $transaction
*/
$transaction = $args['transaction'];
$titles = [
'full_name' => __( 'Name', 'gurmepos' ),
'email' => __( 'E-Mail', 'gurmepos' ),
'phone' => __( 'Phone', 'gurmepos' ),
'address' => __( 'Address', 'gurmepos' ),
'state' => __( 'State', 'gurmepos' ),
'city' => __( 'City', 'gurmepos' ),
];
$site_logo = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' )[0];
$site_desc = get_bloginfo( 'description' );
$site_title = get_bloginfo( 'title' );
?>
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="utf-8">
<meta name="x-apple-disable-message-reformatting">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no, url=no">
<meta name="color-scheme" content="light dark">
<meta name="supported-color-schemes" content="light dark">
<style>
*{
-webkit-print-color-adjust: exact;
font-family: "Roboto","Arial",sans-serif;
word-break: break-all;
}
</style>
</head>
<body style="margin: 0; width: 100%; padding: 0; -webkit-font-smoothing: antialiased; word-break: break-word" onload="window.print()">
<div role="article" aria-label lang="tr">
<div style="display: flex; flex-direction: column; gap: 24px; background-color: #fff; padding: 24px; color: #000">
<div style="display: flex; justify-content: space-between">
<div style="display: flex; width: 66.66666%; flex-direction: column; padding: 24px; border: 1px solid #64748b">
<?php foreach ( [ 'full_name', 'email', 'phone', 'address', 'state', 'city' ] as $prop ) : ?>
<?php $fnc = "get_customer_{$prop}"; ?>
<?php if ( method_exists( $transaction, $fnc ) && $transaction->$fnc() ) : ?>
<div style="display: flex; padding: 4px;">
<div style="width: 20%;">
<?php echo esc_html( $titles[ $prop ] ); ?>
</div>
<div style="width: 80%; font-weight: bold;"> :
<?php echo esc_html( $transaction->$fnc() ); ?>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
<div style="display: flex; width: 33.333333%; flex-direction: column; align-items: center; justify-content: space-between;">
<div style="font-weight: bold;"><?php echo esc_html( $site_title ); ?></div>
<div><img src="<?php echo esc_url( $site_logo ); ?>" alt=""></div>
<div style="font-size: 12px;"><?php echo esc_html( $site_desc ); ?></div>
</div>
</div>
<div style="width: 100%; text-align: right;">
<?php echo esc_html_e( 'Date', 'gurmepos' ); ?>:
<span style="font-weight: bold;">
<?php echo esc_html( $transaction->get_date() ); ?>
</span>
</div>
<div style="display: flex; flex-direction: column; padding: 24px; border: 1px solid #64748b;">
<?php foreach ( $transaction->get_lines() as $key => $line ) : ?>
<div style="display: flex; padding: 8px; <?php echo esc_attr( 0 === $key % 2 ? ' background-color: #e2e8f0;' : '' ); ?> ">
<div style="width: 75%"><?php echo esc_html( $line->get_name() ); ?></div>
<div style="width: 25%; text-align: right; font-weight: bold;"><?php echo esc_html( number_format( $line->get_total(), 2, ',', '.' ) ); ?> <?php echo esc_html( $transaction->get_currency() ); ?></div>
</div>
<?php endforeach; ?>
</div>
<div style="display: flex;">
<div style="width: 75%; font-size: 8px;"><?php esc_html_e( 'It is not an official document, it is produced for informational purposes only.', 'gurmepos' ); ?></div>
<div style="width: 25%; text-align: right;">
<?php echo esc_html_e( 'Total', 'gurmepos' ); ?>:
<span style="font-weight: bold;">
<?php echo esc_html( number_format( $transaction->get_total(), 2, ',', '.' ) ); ?> <?php echo esc_html( $transaction->get_currency() ); ?>
</span>
</div>
</div>
</div>
</div>
</body>
</html>