Ejemplo n.º 1
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $Itemid = JRequest::getInt('Itemid');
     $user = JFactory::getUser();
     $session = JFactory::getSession();
     $auth = $session->get('auth');
     if ($user->id || isset($auth['users_info_id']) && $auth['users_info_id'] > 0) {
         $app->Redirect('index.php?option=com_redshop&view=account&Itemid=' . $Itemid);
     }
     $params = $app->getParams('com_redshop');
     JHTML::Script('joomla.javascript.js', 'includes/js/', false);
     JHTML::Script('jquery-1.4.2.min.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('jquery.validate.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('jquery.metadata.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('registration.js', 'components/com_redshop/assets/js/', false);
     JHTML::Stylesheet('validation.css', 'components/com_redshop/assets/css/');
     $field = new extraField();
     // Field_section 7 : Customer Registration
     $lists['extra_field_user'] = $field->list_all_field(7);
     // Field_section 8 : Company Address
     $lists['extra_field_company'] = $field->list_all_field(8);
     $this->lists = $lists;
     $this->params = $params;
     parent::display($tpl);
 }
Ejemplo n.º 2
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $order_functions = new order_functions();
     // Extra_field;
     $extra_field = new extraField();
     $task = JRequest::getCmd('task');
     $user = JFactory::getUser();
     $uri = JFactory::getURI();
     // Preform security checks
     $session = JFactory::getSession();
     $auth = $session->get('auth');
     $params = $app->getParams('com_redshop');
     $lists = array();
     if ($user->id) {
         $billingaddresses = $order_functions->getBillingAddress($user->id);
     } elseif (isset($auth['users_info_id']) && $auth['users_info_id']) {
         $model = $this->getModel('account_shipto');
         $billingaddresses = $model->_loadData($auth['users_info_id']);
     } else {
         $app->Redirect('index.php?option=com_redshop&view=login&Itemid=' . JRequest::getInt('Itemid'));
         exit;
     }
     if ($task == 'addshipping') {
         JHTML::Script('jquery-1.4.2.min.js', 'components/com_redshop/assets/js/', false);
         JHTML::Script('jquery.validate.js', 'components/com_redshop/assets/js/', false);
         JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
         JHTML::Script('registration.js', 'components/com_redshop/assets/js/', false);
         JHTML::Stylesheet('validation.css', 'components/com_redshop/assets/css/');
         $shippingaddresses = $this->get('Data');
         if ($shippingaddresses->users_info_id > 0 && $shippingaddresses->user_id != $billingaddresses->user_id) {
             echo JText::_('COM_REDSHOP_ALERTNOTAUTH');
             return;
         }
         $lists['shipping_customer_field'] = $extra_field->list_all_field(14, $shippingaddresses->users_info_id);
         $lists['shipping_company_field'] = $extra_field->list_all_field(15, $shippingaddresses->users_info_id);
         $this->setLayout('form');
     } else {
         $shippingaddresses = $order_functions->getShippingAddress($user->id);
     }
     $this->lists = $lists;
     $this->shippingaddresses = $shippingaddresses;
     $this->billingaddresses = $billingaddresses;
     $this->request_url = $uri->toString();
     $this->params = $params;
     parent::display($tpl);
 }
Ejemplo n.º 3
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  */
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $extra_field = new extraField();
     $params = $app->getParams('com_redshop');
     $billingaddresses = $GLOBALS['billingaddresses'];
     if (count($billingaddresses) <= 0) {
         $model = $this->getModel('account_billto');
         $billingaddresses = $model->_initData();
     }
     $user = JFactory::getUser();
     $uri = JFactory::getURI();
     $session = JFactory::getSession();
     $auth = $session->get('auth');
     if (!is_array($auth)) {
         $auth['users_info_id'] = 0;
         $session->set('auth', $auth);
         $auth = $session->get('auth');
     }
     JHTML::Script('jquery-1.4.2.min.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('jquery.validate.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('registration.js', 'components/com_redshop/assets/js/', false);
     JHTML::Stylesheet('validation.css', 'components/com_redshop/assets/css/');
     // Preform security checks
     if ($user->id == 0 && $auth['users_info_id'] == 0) {
         $app->Redirect('index.php?option=com_redshop&view=login&Itemid=' . JRequest::getInt('Itemid'));
         exit;
     }
     $lists['requesting_tax_exempt'] = JHTML::_('select.booleanlist', 'requesting_tax_exempt', 'class="inputbox"', @$billingaddresses->requesting_tax_exempt);
     // Field_section 7 :Customer Address
     $lists['extra_field_user'] = $extra_field->list_all_field(7, @$billingaddresses->users_info_id);
     $lists['extra_field_company'] = $extra_field->list_all_field(8, @$billingaddresses->users_info_id);
     $this->lists = $lists;
     $this->billingaddresses = $billingaddresses;
     $this->request_url = $uri->toString();
     $this->params = $params;
     parent::display($tpl);
 }
Ejemplo n.º 4
0
 /**
  * getCompanyOrCustomer
  *
  * @return  string
  */
 public function getCompanyOrCustomer()
 {
     $redTemplate = new Redtemplate();
     $rsUserhelper = new rsUserhelper();
     $extraField = new extraField();
     $get = JRequest::get('get');
     $template_id = $get['template_id'];
     $is_company = $get['is_company'];
     $lists['extra_field_user'] = $extraField->list_all_field(7);
     $lists['extra_field_company'] = $extraField->list_all_field(8);
     $lists['shipping_customer_field'] = $extraField->list_all_field(14, 0, 'billingRequired valid');
     $lists['shipping_company_field'] = $extraField->list_all_field(15, 0, 'billingRequired valid');
     $lists['isAjax'] = 1;
     if ($is_company == 1) {
         $template = $redTemplate->getTemplate("company_billing_template", $template_id);
         if (count($template) > 0 && $template[0]->template_desc != "") {
             $template_desc = $template[0]->template_desc;
         } else {
             $template_desc = '<table class="admintable" style="height: 221px;" border="0" width="183"><tbody><tr><td width="100" align="right">{email_lbl}:</td><td>{email}</td><td><span class="required">*</span></td></tr><!-- {retype_email_start} --><tr><td width="100" align="right">{retype_email_lbl}</td><td>{retype_email}</td><td><span class="required">*</span></td></tr><!-- {retype_email_end} --><tr><td width="100" align="right">{company_name_lbl}</td><td>{company_name}</td><td><span class="required">*</span></td></tr><!-- {vat_number_start} --><tr><td width="100" align="right">{vat_number_lbl}</td><td>{vat_number}</td><td><span class="required">*</span></td></tr><!-- {vat_number_end} --><tr><td width="100" align="right">{firstname_lbl}</td><td>{firstname}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{lastname_lbl}</td><td>{lastname}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{address_lbl}</td><td>{address}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{zipcode_lbl}</td><td>{zipcode}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{city_lbl}</td><td>{city}</td><td><span class="required">*</span></td></tr><tr id="{country_txtid}" style="{country_style}"><td width="100" align="right">{country_lbl}</td><td>{country}</td><td><span class="required">*</span></td></tr><tr id="{state_txtid}" style="{state_style}"><td width="100" align="right">{state_lbl}</td><td>{state}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{phone_lbl}</td><td>{phone}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{ean_number_lbl}</td><td>{ean_number}</td><td></td></tr><tr><td width="100" align="right">{tax_exempt_lbl}</td><td>{tax_exempt}</td></tr><tr><td colspan="3">{company_extrafield}</td></tr></tbody></table>';
         }
         $template_desc = $rsUserhelper->replaceCompanyCustomer($template_desc, $get, $lists);
     } else {
         $template = $redTemplate->getTemplate("private_billing_template", $template_id);
         if (count($template) > 0 && $template[0]->template_desc != "") {
             $template_desc = $template[0]->template_desc;
         } else {
             $template_desc = '<table class="admintable" style="height: 221px;" border="0" width="183"><tbody><tr><td width="100" align="right">{email_lbl}:</td><td>{email}</td><td><span class="required">*</span></td></tr><!-- {retype_email_start} --><tr><td width="100" align="right">{retype_email_lbl}</td><td>{retype_email}</td><td><span class="required">*</span></td></tr><!-- {retype_email_end} --><tr><td width="100" align="right">{firstname_lbl}</td><td>{firstname}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{lastname_lbl}</td><td>{lastname}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{address_lbl}</td><td>{address}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{zipcode_lbl}</td><td>{zipcode}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{city_lbl}</td><td>{city}</td><td><span class="required">*</span></td></tr><tr id="{country_txtid}" style="{country_style}"><td width="100" align="right">{country_lbl}</td><td>{country}</td><td><span class="required">*</span></td></tr><tr id="{state_txtid}" style="{state_style}"><td width="100" align="right">{state_lbl}</td><td>{state}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{phone_lbl}</td><td>{phone}</td><td><span class="required">*</span></td></tr><tr><td colspan="3">{private_extrafield}</td></tr></tbody></table>';
         }
         $template_desc = $rsUserhelper->replacePrivateCustomer($template_desc, $get, $lists);
     }
     echo $return = "<div id='ajaxRegistrationDiv'>" . $template_desc . "</div>";
     die;
 }
Ejemplo n.º 5
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $model = $this->getModel('checkout');
     $Itemid = JRequest::getInt('Itemid');
     $task = JRequest::getCmd('task');
     $user = JFactory::getUser();
     $redhelper = new redhelper();
     $field = new extraField();
     $session = JFactory::getSession();
     // Load language file
     $payment_lang_list = $redhelper->getPlugins("redshop_payment");
     $language = JFactory::getLanguage();
     $base_dir = JPATH_ADMINISTRATOR;
     $language_tag = $language->getTag();
     for ($l = 0; $l < count($payment_lang_list); $l++) {
         $extension = 'plg_redshop_payment_' . $payment_lang_list[$l]->element;
         $language->load($extension, $base_dir, $language_tag, true);
     }
     JHTML::Script('joomla.javascript.js', 'includes/js/', false);
     JHTML::Script('validate.js', 'media/system/js/', false);
     JHTML::Script('jquery-1.4.2.min.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('jquery.validate.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('jquery.metadata.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('registration.js', 'components/com_redshop/assets/js/', false);
     JHTML::Stylesheet('validation.css', 'components/com_redshop/assets/css/');
     JHTML::Script('redBOX.js', 'components/com_redshop/assets/js/', false);
     if (JPluginHelper::isEnabled('redshop_veis_registration', 'rs_veis_registration')) {
         JHTML::Script('veis.js', 'plugins/redshop_veis_registration/rs_veis_registration/js/', false);
     }
     $cart = $session->get('cart');
     $auth = $session->get('auth');
     if (!is_array($auth)) {
         $auth['users_info_id'] = 0;
         $session->set('auth', $auth);
         $auth = $session->get('auth');
     }
     if ($cart['idx'] < 1) {
         $msg = JText::_('COM_REDSHOP_EMPTY_CART');
         $link = 'index.php?option=com_redshop&Itemid=' . $Itemid;
         $app->Redirect($link, $msg);
     }
     $lists = array();
     if ($task != '') {
         $tpl = $task;
     } else {
         if ($user->id || $auth['users_info_id'] > 0) {
             $cart = $session->get('cart');
             if (DEFAULT_QUOTATION_MODE == 1 && !array_key_exists("quotation_id", $cart)) {
                 $app->Redirect('index.php?option=com_redshop&view=quotation&Itemid=' . $Itemid);
             }
             $users_info_id = JRequest::getInt('users_info_id');
             $billingaddresses = $model->billingaddresses();
             $shippingaddresses = $model->shippingaddresses();
             if (!$users_info_id) {
                 if ((!isset($users_info_id) || $users_info_id == 0) && count($shippingaddresses) > 0) {
                     $users_info_id = $shippingaddresses[0]->users_info_id;
                 } elseif ((!isset($users_info_id) || $users_info_id == 0) && count($billingaddresses) > 0) {
                     $users_info_id = $billingaddresses->users_info_id;
                 } else {
                     $app->Redirect("index.php?option=com_redshop&view=account_billto&Itemid=" . $Itemid);
                 }
             }
             $shipping_rate_id = JRequest::getInt('shipping_rate_id');
             $element = JRequest::getCmd('payment_method_id');
             $ccinfo = JRequest::getInt('ccinfo');
             $total_discount = $cart['cart_discount'] + $cart['voucher_discount'] + $cart['coupon_discount'];
             $subtotal = SHIPPING_AFTER == 'total' ? $cart['product_subtotal'] - $total_discount : $cart['product_subtotal'];
             $this->users_info_id = $users_info_id;
             $this->shipping_rate_id = $shipping_rate_id;
             $this->element = $element;
             $this->ccinfo = $ccinfo;
             $this->order_subtotal = $subtotal;
             $this->ordertotal = $cart['total'];
         } else {
             // Field_section 6 : Customer Registration
             $lists['extra_field_user'] = $field->list_all_field(7);
             // Field_section 6 : Company Address
             $lists['extra_field_company'] = $field->list_all_field(8);
             $lists['shipping_customer_field'] = $field->list_all_field(14, 0, 'billingRequired valid');
             $lists['shipping_company_field'] = $field->list_all_field(15, 0, 'billingRequired valid');
         }
     }
     if (($user->id || $auth['users_info_id'] > 0) && ONESTEP_CHECKOUT_ENABLE) {
         $this->setLayout('onestepcheckout');
     }
     $this->lists = $lists;
     parent::display($tpl);
 }