yf_shop_order_validate_data user module

Fileplugins/shop/modules/shop/yf_shop_order_validate_data.class.php
Usemodule('shop_order_validate_data'), URL ?object=shop_order_validate_data

Public properties

PropertyDefaultDescription
None declared in this class.

Public methods 1

None without a leading underscore.

Methods starting with _ hooks and helpers; not routable as page actions

public function _order_validate_data()

validate order data for view order.

    public function _order_validate_data()
    {
        if (empty($_POST['order_id'])) {
            _re('Order empty');
        }
        $order_info = db()->query_fetch('SELECT * FROM ' . db('shop_orders') . ' WHERE id=' . (int) (($_POST['order_id'] ?? null)));
        if (empty($order_info)) {
            _re('No such order');
        }
        if (empty($_POST['email'])) {
            _re('e-mail empty');
        } elseif ( ! common()->email_verify(($_POST['email'] ?? null))) {
            _re('email not valid.');
        } elseif ($order_info['email'] != ($_POST['email'] ?? null)) {
            _re('The order has been issued on other name');
        }
    }