getDeviceType example


        $sql = ' INSERT INTO s_statistics_currentusers (remoteaddr, page, `time`, userID, deviceType) VALUES (?, ?, NOW(), ?, ?)';

        $ip = $this->get(IpAnonymizerInterface::class)->anonymize($request->getClientIp());

        Shopware()->Db()->query($sql[
            $ip,
            $request->getParam('requestPage', $request->getRequestUri()),
            empty(Shopware()->Session()->get('sUserId')) ? 0 : (int) Shopware()->Session()->get('sUserId'),
            $request->getDeviceType(),
        ]);
    }

    /** * Refresh visitor log * * @throws Exception * * @return void */
    public function refreshLog(Enlight_Controller_Request_Request $request)
    {
$order->sBasketData = $basket;
            $order->sAmount = $basket[CheckoutKey::AMOUNT];
            $order->sAmountWithTax = !empty($basket[CartKey::AMOUNT_WITH_TAX_NUMERIC]) ? $basket[CartKey::AMOUNT_WITH_TAX_NUMERIC] : $basket[CartKey::AMOUNT_NUMERIC];
            $order->sAmountNet = $basket[CartKey::AMOUNT_NET_NUMERIC];
            $order->sShippingcosts = $basket[CheckoutKey::SHIPPING_COSTS];
            $order->sShippingcostsNumeric = $basket[CheckoutKey::SHIPPING_COSTS_WITH_TAX];
            $order->sShippingcostsNumericNet = $basket[CheckoutKey::SHIPPING_COSTS_NET];
            $order->bookingId = $transactionId;
            $order->dispatchId = Shopware()->Session()->get('sDispatch');
            $order->sNet = empty($user['additional']['charge_vat']);
            $order->uniqueID = $paymentUniqueId;
            $order->deviceType = $this->Request()->getDeviceType();
            $orderNumber = $order->sSaveOrder();
        }

        if (!empty($orderNumber) && !empty($paymentStatusId)) {
            $this->savePaymentStatus($transactionId$paymentUniqueId$paymentStatusId$sendStatusMail);
        }

        return $orderNumber;
    }

    /** * Saves the payment status an sends and possibly sends a status email. * * @param string $transactionId * @param string $paymentUniqueId * @param int $paymentStatusId * @param bool $sendStatusMail */
public function sGetPaymentMeanById($id$user = false)
    {
        $id = (int) $id;
        $resetPayment = false;

        $data = $this->db->fetchRow(
            'SELECT * FROM s_core_paymentmeans WHERE id = ?',
            [$id]
        ) ?: [];

        $sEsd = $this->moduleManager->Basket()->sCheckForESD();
        $isMobile = $this->front->Request()->getDeviceType() === 'mobile';

        $customer = $user;
        if (!\is_array($customer)) {
            $customer = [];
        }

        $paymentId = $data['id'] ?? null;

        // Check for risk management         // If rules match, reset to default payment mean if this payment mean was not         // set by shop owner
$order->sUserData = $this->View()->getAssign('sUserData');
        $order->sComment = $this->session['sComment'] ?? '';
        $order->sBasketData = $normalizer->normalize($this->View()->getAssign('sBasket'));
        $order->sAmount = $this->View()->getAssign('sBasket')[CheckoutKey::AMOUNT];
        $order->sAmountWithTax = !empty($this->View()->getAssign('sBasket')[CartKey::AMOUNT_WITH_TAX_NUMERIC]) ? $this->View()->getAssign('sBasket')[CartKey::AMOUNT_WITH_TAX_NUMERIC] : $this->View()->getAssign('sBasket')[CartKey::AMOUNT_NUMERIC];
        $order->sAmountNet = $this->View()->getAssign('sBasket')[CartKey::AMOUNT_NET_NUMERIC];
        $order->sShippingcosts = $this->View()->getAssign('sBasket')[CheckoutKey::SHIPPING_COSTS];
        $order->sShippingcostsNumeric = $this->View()->getAssign('sBasket')[CheckoutKey::SHIPPING_COSTS_WITH_TAX];
        $order->sShippingcostsNumericNet = $this->View()->getAssign('sBasket')[CheckoutKey::SHIPPING_COSTS_NET];
        $order->dispatchId = $this->session['sDispatch'];
        $order->sNet = !$this->View()->getAssign('sUserData')['additional']['charge_vat'];
        $order->deviceType = $this->Request()->getDeviceType();

        $order->sDeleteTemporaryOrder();    // Delete previous temporary orders         $order->sCreateTemporaryOrder();    // Create new temporary order     }

    /** * @deprecated in 5.6, will be protected in 5.8 * * Finish order - set some object properties to do this * * @return string|false */
Home | Imprint | This part of the site doesn't use cookies.