Beispiel #1
0
 /**
  * checkout function
  *
  * @access public
  * @return void
  */
 public function checkout()
 {
     $option = JRequest::getVar('option');
     $Itemid = JRequest::getVar('Itemid');
     $post = JRequest::get('post');
     $encr = JRequest::getVar('encr');
     $quotationHelper = new quotationHelper();
     $model = $this->getmodel();
     $session = JFactory::getSession();
     $redhelper = new redhelper();
     $cart = array();
     $cart['idx'] = 0;
     $session->set('cart', $cart);
     $quotationProducts = $quotationHelper->getQuotationProduct($post['quotation_id']);
     for ($q = 0; $q < count($quotationProducts); $q++) {
         $model->addtocart($quotationProducts[$q]);
     }
     $cart = $session->get('cart');
     $quotationDetail = $quotationHelper->getQuotationDetail($post['quotation_id']);
     $cart['customer_note'] = $quotationDetail->quotation_note;
     $cart['quotation_id'] = $quotationDetail->quotation_id;
     $cart['cart_discount'] = $quotationDetail->quotation_discount;
     $cart['quotation'] = 1;
     $session->set('cart', $cart);
     $model->modifyQuotation($quotationDetail->user_id);
     $Itemid = $redhelper->getCheckoutItemid();
     $this->setRedirect('index.php?option=' . $option . '&view=checkout&quotation=1&encr=' . $encr . '&Itemid=' . $Itemid);
 }
Beispiel #2
0
 /**
  *  Setlogin function
  *
  * @return  void
  */
 public function setlogin()
 {
     $username = JRequest::getVar('username', '', 'method', 'username');
     $password = JRequest::getString('password', '', 'post', JREQUEST_ALLOWRAW);
     $option = JRequest::getVar('option');
     $Itemid = JRequest::getVar('Itemid');
     $returnitemid = JRequest::getVar('returnitemid');
     $mywishlist = JRequest::getVar('mywishlist');
     $menu = JFactory::getApplication()->getMenu();
     $item = $menu->getItem($returnitemid);
     include_once JPATH_COMPONENT . '/helpers/helper.php';
     $redhelper = new redhelper();
     $model = $this->getModel('login');
     $shoppergroupid = JRequest::getInt('protalid', '', 'post', 0);
     $msg = "";
     if ($shoppergroupid != 0) {
         $check = $model->CheckShopperGroup($username, $shoppergroupid);
         $link = "index.php?option=" . $option . "&view=login&layout=portal&protalid=" . $shoppergroupid;
         if ($check > 0) {
             $model->setlogin($username, $password);
             $return = JRequest::getVar('return');
         } else {
             $msg = JText::_("COM_REDSHOP_SHOPPERGROUP_NOT_MATCH");
             $return = "";
         }
     } else {
         $model->setlogin($username, $password);
         $return = JRequest::getVar('return');
     }
     if ($mywishlist == 1) {
         $wishreturn = JRoute::_('index.php?loginwishlist=1&option=com_redshop&view=wishlist&Itemid=' . $Itemid, false);
         $this->setRedirect($wishreturn);
     } else {
         if ($item) {
             $link = $item->link . '&Itemid=' . $returnitemid;
         } else {
             $link = 'index.php?option=' . $option . '&Itemid=' . $returnitemid;
         }
         if (!empty($return)) {
             $s_Itemid = $redhelper->getCheckoutItemid();
             $Itemid = $s_Itemid ? $s_Itemid : $Itemid;
             $return = JRoute::_('index.php?option=com_redshop&view=checkout&Itemid=' . $Itemid, false);
             $this->setRedirect($return);
         } else {
             $this->setRedirect($link, $msg);
         }
     }
 }
Beispiel #3
0
/**
 * @package     RedSHOP.Frontend
 * @subpackage  Template
 *
 * @copyright   Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */
defined('_JEXEC') or die;
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/order.php';
include_once JPATH_COMPONENT . '/helpers/helper.php';
$configobj = new Redconfiguration();
$order_functions = new order_functions();
$redhelper = new redhelper();
$url = JURI::base();
$Itemid = $redhelper->getCheckoutItemid();
$order_id = JRequest::getInt('oid');
$order = $order_functions->getOrderDetails($order_id);
$orderitem = $order_functions->getOrderItemDetail($order_id);
if ($order->order_total > 0 && !USE_AS_CATALOG) {
    $paymentmethod = $order_functions->getOrderPaymentDetail($order_id);
    $paymentmethod = $order_functions->getPaymentMethodInfo($paymentmethod[0]->payment_method_class);
    $paymentmethod = $paymentmethod[0];
    $paymentpath = JPATH_SITE . '/plugins/redshop_payment/' . $paymentmethod->element . '/' . $paymentmethod->element . '.xml';
    $paymentparams = new JRegistry($paymentmethod->params);
    echo '<div>';
    $is_creditcard = $paymentparams->get('is_creditcard', '');
    $is_redirected = $paymentparams->get('is_redirected', 0);
    if (!$is_creditcard || $is_redirected == 1) {
        $adminpath = JPATH_ADMINISTRATOR . '/components/com_redshop';
        $invalid_elements = $paymentparams->get('invalid_elements', '');