/*
Theme Name: Gowilds
Theme URI: https://gaviaspreview.com/wp/gowilds/
Author URI: https://themeforest.net/user/gavias
Author: Gaviasthemes Team
Description: The 2023 theme for WordPress is a fully responsive theme that looks great on any device.
Version: 1.1.6
Tested up to: 5.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: one-column, two-columns, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, sticky-post, theme-options, translation-ready
Text Domain: gowilds

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/
.wp-caption-text{
   font-weight: 400;
   font-size: 14px;
   font-style: italic;
   color: #3f3836;
}
.gallery-caption{
   font-weight: 500;
}
.bypostauthor{
   text-align: left;
}
// 1. Show PhonePe payment option on the BA Book Everything checkout page
add_action('booking_activity_after_booking_form', 'gowilds_show_phonepe_payment');

function gowilds_show_phonepe_payment() {
    ?>
    <div style="margin-top: 30px; border: 2px dashed #8e44ad; padding: 20px; border-radius: 10px;">
        <h3 style="color: #8e44ad;">Pay via PhonePe</h3>
        <p>Scan the QR code or use the UPI ID below to make the payment.</p>
        <img src="<?php echo get_stylesheet_directory_uri(); ?>/assets/images/phonepe-qr.png" alt="PhonePe QR" style="max-width:200px; margin-bottom: 10px;" />
        <p><strong>UPI ID:</strong> yourupi@bank</p>
        <label for="phonepe_txn_id">Enter PhonePe Transaction ID:</label>
        <input type="text" name="phonepe_txn_id" id="phonepe_txn_id" required style="width: 100%; padding: 8px; margin-top: 8px;" placeholder="e.g. TXN12345ABC">
    </div>
    <?php
}

// 2. Save the PhonePe transaction ID with booking data
add_action('booking_activity_after_booking_save', 'gowilds_save_phonepe_txn_id', 10, 2);

function gowilds_save_phonepe_txn_id($booking_id, $form_data) {
    if (!empty($_POST['phonepe_txn_id'])) {
        update_post_meta($booking_id, 'phonepe_txn_id', sanitize_text_field($_POST['phonepe_txn_id']));
    }
}

