public function display($tpl = null) { $Redconfiguration = new Redconfiguration(); $uri = JFactory::getURI(); $lists = array(); $detail = $this->get('data'); $isNew = $detail->zipcode_id < 1; $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT'); JToolBarHelper::title(JText::_('COM_REDSHOP_ZIPCODE_DETAIL') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_region_48'); JToolBarHelper::save(); JToolBarHelper::apply(); if ($isNew) { JToolBarHelper::cancel(); } else { JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE')); } $countryarray = $Redconfiguration->getCountryList((array) $detail); $detail->country_code = $countryarray['country_code']; $lists['country_code'] = $countryarray['country_dropdown']; $statearray = $Redconfiguration->getStateList((array) $detail); $lists['state_code'] = $statearray['state_dropdown']; $this->detail = $detail; $this->lists = $lists; $this->request_url = $uri->toString(); parent::display($tpl); }
public function display($tpl = null) { $option = JRequest::getVar('option'); $extra_field = new extra_field(); $order_functions = new order_functions(); $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_REDSHOP_QUOTATION_MANAGEMENT')); $document->addScript('components/' . $option . '/assets/js/json.js'); $document->addScript('components/' . $option . '/assets/js/validation.js'); $document->addScript('components/' . $option . '/assets/js/order.js'); $document->addScript('components/' . $option . '/assets/js/common.js'); $document->addScript('components/' . $option . '/assets/js/select_sort.js'); $document->addStyleSheet('components/' . $option . '/assets/css/search.css'); $document->addScript('components/' . $option . '/assets/js/search.js'); $session = JFactory::getSession(); $uri = JFactory::getURI(); $lists = array(); $model = $this->getModel(); $detail = $this->get('Data'); $Redconfiguration = new Redconfiguration(); $user_id = JRequest::getVar('user_id', 0); if ($user_id != 0) { $billing = $order_functions->getBillingAddress($user_id); } else { $billing = $model->setBilling(); } if (!is_object($detail)) { $detail = new stdClass(); } $detail->user_id = $user_id; $session->set('offlineuser_id', $user_id); $userop = array(); $userop[0] = new stdClass(); $userop[0]->user_id = 0; $userop[0]->text = JText::_('COM_REDSHOP_SELECT'); $userlists = $model->getUserData(0, "BT"); $userlist = array_merge($userop, $userlists); $lists['userlist'] = JHTML::_('select.genericlist', $userlist, 'user_id', 'class="inputbox" onchange="showquotationUserDetail();" ', 'user_id', 'text'); JToolBarHelper::title(JText::_('COM_REDSHOP_QUOTATION_MANAGEMENT') . ': <small><small>[ ' . JText::_('COM_REDSHOP_NEW') . ' ]</small></small>', 'redshop_order48'); JToolBarHelper::save(); JToolBarHelper::custom('send', 'send.png', 'send.png', JText::_('COM_REDSHOP_SEND'), false); JToolBarHelper::cancel(); // PRODUCT/ATTRIBUTE STOCK ROOM QUANTITY CHECKING IS IMPLEMENTED $countryarray = $Redconfiguration->getCountryList((array) $billing); $billing->country_code = $countryarray['country_code']; $lists['country_code'] = $countryarray['country_dropdown']; $statearray = $Redconfiguration->getStateList((array) $billing); $lists['state_code'] = $statearray['state_dropdown']; $lists['quotation_extrafield'] = $extra_field->list_all_field(16, $billing->users_info_id); $this->lists = $lists; $this->detail = $detail; $this->billing = $billing; $this->userlist = $userlists; $this->request_url = $uri->toString(); parent::display($tpl); }
public function changeshippingaddress($shippingadd_id, $user_id, $is_company) { $extra_field = new extra_field(); $Redconfiguration = new Redconfiguration(); $query = 'SELECT * FROM ' . $this->_table_prefix . 'users_info ' . 'WHERE address_type like "ST" ' . 'AND user_id = ' . (int) $user_id . ' ' . 'AND users_info_id = ' . (int) $shippingadd_id; $this->_db->setQuery($query); $list = $this->_db->loadObject(); if (count($list) > 0) { $shipping = $list; } else { $shipping = $this->setShipping(); } $allowCustomer = ''; $allowCompany = ''; if ($is_company) { $allowCustomer = 'style="display:none;"'; } else { $allowCompany = 'style="display:none;"'; } // Field_section 7 :Customer Address $lists['shipping_customer_field'] = $extra_field->list_all_field(14, $shipping->users_info_id); // Field_section 8 :Company Address $lists['shipping_company_field'] = $extra_field->list_all_field(15, $shipping->users_info_id); $countryarray = $Redconfiguration->getCountryList((array) $shipping, "country_code_ST", "ST"); $shipping->country_code_ST = $shipping->country_code = $countryarray['country_code_ST']; $lists['country_code_ST'] = $countryarray['country_dropdown']; $statearray = $Redconfiguration->getStateList((array) $shipping, "state_code_ST", "country_code_ST", "ST", 1); $lists['state_code_ST'] = $statearray['state_dropdown']; $htmlshipping = '<table class="adminlist" border="0" width="100%">'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('FIRSTNAME') . ':</td>'; $htmlshipping .= '<td><input class="inputbox" type="text" name="firstname_ST" maxlength="250" value="' . $shipping->firstname . '" /></td></tr>'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('LASTNAME') . ':</td>'; $htmlshipping .= '<td><input class="inputbox" type="text" name="lastname_ST" maxlength="250" value="' . $shipping->lastname . '" /></td></tr>'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('ADDRESS') . ':</td>'; $htmlshipping .= '<td><input class="inputbox" type="text" name="address_ST" maxlength="250" value="' . $shipping->address . '" /></td></tr>'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('ZIP') . ':</td>'; $htmlshipping .= '<td><input class="inputbox" type="text" name="zipcode_ST" maxlength="250" value="' . $shipping->zipcode . '" /></td></tr>'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('CITY') . ':</td>'; $htmlshipping .= '<td><input class="inputbox" type="text" name="city_ST" maxlength="250" value="' . $shipping->city . '" /></td></tr>'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('COUNTRY') . ':</td>'; $htmlshipping .= '<td>' . $lists['country_code_ST'] . '</td></tr>'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('STATE') . ':</td>'; $htmlshipping .= '<td>' . $lists['state_code_ST'] . '</td></tr>'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('PHONE') . ':</td>'; $htmlshipping .= '<td><input class="inputbox" type="text" name="phone_ST" maxlength="250" value="' . $shipping->phone . '" /></td></tr>'; $htmlshipping .= '<tr><td colspan="2"><div id="exCustomerFieldST" ' . $allowCustomer . '>' . $lists['shipping_customer_field'] . '</div> <div id="exCompanyFieldST" ' . $allowCompany . '>' . $lists['shipping_company_field'] . '</div></td></tr>'; $htmlshipping .= '</table>'; return $htmlshipping; }
public function display($tpl = null) { $option = JRequest::getVar('option'); $extra_field = new extra_field(); $order_functions = new order_functions(); $Redconfiguration = new Redconfiguration(); $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_REDSHOP_ORDER')); $document->addScript('components/' . $option . '/assets/js/select_sort.js'); $document->addStyleSheet('components/' . $option . '/assets/css/search.css'); $document->addScript('components/' . $option . '/assets/js/search.js'); $document->addScript('components/' . $option . '/assets/js/json.js'); $document->addScript('components/' . $option . '/assets/js/validation.js'); $document->addScript('components/' . $option . '/assets/js/order.js'); $document->addScript('components/' . $option . '/assets/js/common.js'); $uri = JFactory::getURI(); $lists = array(); $billing = array(); $shippinginfo = array(); $model = $this->getModel(); $detail = $this->get('data'); $redhelper = new redhelper(); $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); } $err = JRequest::getVar('err', ''); $shipping_rate_id = JRequest::getVar('shipping_rate_id'); $user_id = JRequest::getVar('user_id', 0); if ($user_id != 0) { $billing = $order_functions->getBillingAddress($user_id); $shippinginfo = $order_functions->getShippingAddress($user_id); } else { $billing = $model->setBilling(); } $shipping_country = 0; $shipping_state = 0; $key = 0; $shippingop = array(); $shippingop[0] = new stdClass(); $shippingop[0]->users_info_id = 0; $shippingop[0]->text = JText::_('COM_REDSHOP_SELECT'); if (count($shippinginfo) > 0) { $shipping_users_info_id = JRequest::getVar('shipping_users_info_id', 0); if ($shipping_users_info_id != 0) { for ($o = 0; $o < count($shippinginfo); $o++) { if ($shippinginfo[$o]->users_info_id == $shipping_users_info_id) { $key = $o; break; } } $shipping_country = $shippinginfo[$key]->country_code; $shipping_state = $shippinginfo[$key]->state_code; } $shippingop = array_merge($shippingop, $shippinginfo); $billisship = $shippinginfo[$key]->billisship = $shipping_users_info_id ? 0 : 1; } else { $shippinginfo[0] = $model->setShipping(); $shipping_users_info_id = $shippinginfo[0]->users_info_id = 0; $billisship = $shippinginfo[0]->billisship; } $shdisable = $billisship ? "disabled" : ""; $detail->user_id = $user_id; $lists['shippinginfo_list'] = JHTML::_('select.genericlist', $shippingop, 'shipp_users_info_id', 'class="inputbox" ' . $shdisable . ' onchange="getShippinginfo(this.value, ' . $billing->is_company . ');" ', 'users_info_id', 'text', $shipping_users_info_id); $payment_detail = $this->get('payment'); JToolBarHelper::title(JText::_('COM_REDSHOP_ORDER') . ': <small><small>[ ' . JText::_('COM_REDSHOP_NEW') . ' ]</small></small>', 'redshop_order48'); if ($err == "" && array_key_exists("users_info_id", $billing) && $billing->users_info_id) { JToolBarHelper::custom('savepay', 'save.png', 'save_f2.png', 'Save + Pay', false); JToolBarHelper::custom('save_without_sendmail', 'save.png', 'save_f2.png', JText::_('COM_REDSHOP_SAVE_WITHOUT_SEND_ORDERMAIL_LBL'), false); JToolBarHelper::save(); } JToolBarHelper::cancel(); $countryarray = $Redconfiguration->getCountryList((array) $billing, "country_code", "BT"); $billing->country_code = $countryarray['country_code']; $lists['country_code'] = $countryarray['country_dropdown']; $statearray = $Redconfiguration->getStateList((array) $billing, "state_code", "country_code", "BT", 1); $lists['state_code'] = $statearray['state_dropdown']; $shipping['country_code_ST'] = $shippinginfo[$key]->country_code; $countryarray = $Redconfiguration->getCountryList((array) $shipping, "country_code_ST", "ST"); $shipping['country_code_ST'] = $shippinginfo[$key]->country_code = $countryarray['country_code_ST']; $lists['country_code_ST'] = $countryarray['country_dropdown']; $statearray = $Redconfiguration->getStateList((array) $shipping, "state_code_ST", "country_code_ST", "ST", 1); $lists['state_code_ST'] = $statearray['state_dropdown']; $lists['is_company'] = JHTML::_('select.booleanlist', 'is_company', 'class="inputbox" onchange="showOfflineCompanyOrCustomer(this.value);" ', $billing->is_company, JText::_('COM_REDSHOP_USER_COMPANY'), JText::_('COM_REDSHOP_USER_CUSTOMER')); $lists['customer_field'] = $extra_field->list_all_field(7, $billing->users_info_id); $lists['company_field'] = $extra_field->list_all_field(8, $billing->users_info_id); $lists['shipping_customer_field'] = $extra_field->list_all_field(14, $shippinginfo[0]->users_info_id); $lists['shipping_company_field'] = $extra_field->list_all_field(15, $shippinginfo[0]->users_info_id); $this->lists = $lists; $this->detail = $detail; $this->billing = $billing; $this->shipping = $shippinginfo[$key]; $this->shipping_users_info_id = $shipping_users_info_id; $this->payment_detail = $payment_detail; $this->shipping_rate_id = $shipping_rate_id; $this->request_url = $uri->toString(); parent::display($tpl); }
/** * shipping rate calculator */ public function shippingrate_calc() { $document = JFactory::getDocument(); JHTML::Script('commmon.js', 'components/com_redshop/assets/js/', false); $redConfig = new Redconfiguration(); $countryarray = $redConfig->getCountryList(); $post['country_code'] = $countryarray['country_code']; $conutry = $countryarray['country_dropdown']; $statearray = $redConfig->getStateList($post); $state = $statearray['state_dropdown']; $shipping_calc = "<form name='adminForm' id='adminForm'>"; $shipping_calc .= "<label>" . JText::_('COM_REDSHOP_COUNTRY') . "</label><br />"; $shipping_calc .= $conutry; $shipping_calc .= "<div id='div_state_lbl'><label>" . JText::_('COM_REDSHOP_STATE') . "</label></div>"; $shipping_calc .= "<div id='div_state_txt'>" . $state . "</div>"; $shipping_calc .= "<br />"; $shipping_calc .= "<label>" . JText::_('COM_REDSHOP_ZIPCODE') . "</label><br />"; $shipping_calc .= "<input type='text' name='zipcode' id='zip_code' />"; $shipping_calc .= "<br />"; $shipping_calc .= "<input class='blackbutton' type='button' name='shippingcalc' id='shippingcalc' value='" . JText::_('COM_REDSHOP_UPDATE') . "' onClick='javascript:getShippingrate();' />"; $shipping_calc .= "</form>"; return $shipping_calc; }
public function display($tpl = null) { $option = JRequest::getVar('option'); $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_REDSHOP_ORDER')); $order_functions = new order_functions(); $redhelper = new redhelper(); $uri = JFactory::getURI(); // 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); } $layout = JRequest::getVar('layout'); $document->addScript('components/' . $option . '/assets/js/order.js'); $document->addScript('components/' . $option . '/assets/js/common.js'); $document->addScript('components/' . $option . '/assets/js/validation.js'); $document->addScript(JURI::base() . 'components/' . $option . '/assets/js/select_sort.js'); $document->addStyleSheet(JURI::base() . 'components/' . $option . '/assets/css/search.css'); $document->addScript(JURI::base() . 'components/' . $option . '/assets/js/search.js'); $document->addScript(JURI::base() . 'components/' . $option . '/assets/js/json.js'); $lists = array(); $model = $this->getModel(); $detail = $this->get('data'); $billing = $order_functions->getOrderBillingUserInfo($detail->order_id); $shipping = $order_functions->getOrderShippingUserInfo($detail->order_id); $task = JRequest::getVar('task'); if ($task == 'ccdetail') { $ccdetail = $model->getccdetail($detail->order_id); $this->ccdetail = $ccdetail; $this->setLayout('ccdetail'); parent::display($tpl); exit; } if ($layout == 'shipping' || $layout == 'billing') { if (!$shipping || $layout == 'billing') { $shipping = $billing; } $this->setLayout($layout); $Redconfiguration = new Redconfiguration(); $countryarray = $Redconfiguration->getCountryList((array) $shipping); $shipping->country_code = $countryarray['country_code']; $lists['country_code'] = $countryarray['country_dropdown']; $statearray = $Redconfiguration->getStateList((array) $shipping); $lists['state_code'] = $statearray['state_dropdown']; $showcountry = count($countryarray['countrylist']) == 1 && count($statearray['statelist']) == 0 ? 0 : 1; $showstate = $statearray['is_states'] <= 0 ? 0 : 1; $this->showcountry = $showcountry; $this->showstate = $showstate; } elseif ($layout == "print_order" || $layout == 'productorderinfo' || $layout == 'creditcardpayment') { $this->setLayout($layout); } else { $this->setLayout('default'); } $payment_detail = $order_functions->getOrderPaymentDetail($detail->order_id); if (count($payment_detail) > 0) { $payment_detail = $payment_detail[0]; } $isNew = $detail->order_id < 1; $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT'); JToolBarHelper::title(JText::_('COM_REDSHOP_ORDER') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_order48'); $redhelper = new redhelper(); $backlink = 'index.php?option=com_redshop&view=order'; $backlink = $redhelper->sslLink($backlink, 0); $new_link = 'index.php?option=com_redshop&view=order'; JToolBarHelper::back(JText::_('COM_REDSHOP_ORDERLIST'), 'javascript:location.href=\'' . $new_link . '\';'); // Section can be added from here $option = array(); $option[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_SELECT')); $this->lists = $lists; $this->detail = $detail; $this->billing = $billing; $this->shipping = $shipping; $this->payment_detail = $payment_detail; $this->shipping_rate_id = $detail->ship_method_id; $this->request_url = $uri->toString(); parent::display($tpl); }
public function display($tpl = null) { $Redconfiguration = new Redconfiguration(); $userhelper = new rsUserhelper(); $extra_field = new extra_field(); $shipping = JRequest::getVar('shipping', '', 'request', 'string'); $option = JRequest::getVar('option', '', 'request', 'string'); $document = JFactory::getDocument(); $document->addScript('components/' . $option . '/assets/js/json.js'); $document->addScript('components/' . $option . '/assets/js/validation.js'); $uri = JFactory::getURI(); $this->setLayout('default'); $lists = array(); $detail = $this->get('data'); $isNew = $detail->users_info_id < 1; $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT'); if ($shipping) { JToolBarHelper::title(JText::_('COM_REDSHOP_USER_SHIPPING_DETAIL') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_user48'); } else { JToolBarHelper::title(JText::_('COM_REDSHOP_USER_MANAGEMENT_DETAIL') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_user48'); } JToolBarHelper::apply(); JToolBarHelper::save(); if ($isNew) { JToolBarHelper::cancel(); } else { JToolBarHelper::customX('order', 'redshop_order32', '', JText::_('COM_REDSHOP_PLACE_ORDER'), false); JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE')); } $pagination = $this->get('Pagination'); $user_groups = $userhelper->getUserGroupList($detail->users_info_id); $detail->user_groups = $user_groups; $shopper_detail = $userhelper->getShopperGroupList(); $temps = array(); $temps[0] = new stdClass(); $temps[0]->value = 0; $temps[0]->text = JText::_('COM_REDSHOP_SELECT'); $shopper_detail = array_merge($temps, $shopper_detail); $lists['shopper_group'] = JHTML::_('select.genericlist', $shopper_detail, 'shopper_group_id', '', 'value', 'text', $detail->shopper_group_id); $lists['tax_exempt'] = JHTML::_('select.booleanlist', 'tax_exempt', 'class="inputbox"', $detail->tax_exempt); $lists['block'] = JHTML::_('select.booleanlist', 'block', 'class="inputbox"', $detail->block); $lists['tax_exempt_approved'] = JHTML::_('select.booleanlist', 'tax_exempt_approved', 'class="inputbox"', $detail->tax_exempt_approved); $lists['requesting_tax_exempt'] = JHTML::_('select.booleanlist', 'requesting_tax_exempt', 'class="inputbox"', $detail->requesting_tax_exempt); $lists['is_company'] = JHTML::_('select.booleanlist', 'is_company', 'class="inputbox" onchange="showOfflineCompanyOrCustomer(this.value);" ', $detail->is_company, JText::_('COM_REDSHOP_USER_COMPANY'), JText::_('COM_REDSHOP_USER_CUSTOMER')); $lists['sendEmail'] = JHTML::_('select.booleanlist', 'sendEmail', 'class="inputbox"', $detail->sendEmail); $lists['extra_field'] = $extra_field->list_all_field(6, $detail->users_info_id); $lists['customer_field'] = $extra_field->list_all_field(7, $detail->users_info_id); $lists['company_field'] = $extra_field->list_all_field(8, $detail->users_info_id); $lists['shipping_customer_field'] = $extra_field->list_all_field(14, $detail->users_info_id); $lists['shipping_company_field'] = $extra_field->list_all_field(15, $detail->users_info_id); $countryarray = $Redconfiguration->getCountryList((array) $detail); $detail->country_code = $countryarray['country_code']; $lists['country_code'] = $countryarray['country_dropdown']; $statearray = $Redconfiguration->getStateList((array) $detail); $lists['state_code'] = $statearray['state_dropdown']; $this->lists = $lists; $this->detail = $detail; $this->request_url = $uri->toString(); $this->pagination = $pagination; parent::display($tpl); }
public function getShippingTable($post = array(), $is_company = 0, $lists) { $Redconfiguration = new Redconfiguration(); $redTemplate = new Redtemplate(); $shipping_template = $redTemplate->getTemplate("shipping_template"); if (count($shipping_template) > 0 && $shipping_template[0]->template_desc != "") { $template_desc = $shipping_template[0]->template_desc; } else { $template_desc = '<table class="admintable" border="0"><tbody><tr><td width="100" align="right">{firstname_st_lbl}</td><td>{firstname_st}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{lastname_st_lbl}</td><td>{lastname_st}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{address_st_lbl}</td><td>{address_st}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{zipcode_st_lbl}</td><td>{zipcode_st}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{city_st_lbl}</td><td>{city_st}</td><td><span class="required">*</span></td></tr><tr id="{country_st_txtid}" style="{country_st_style}"><td width="100" align="right">{country_st_lbl}</td><td>{country_st}</td><td><span class="required">*</span></td></tr><tr id="{state_st_txtid}" style="{state_st_style}"><td width="100" align="right">{state_st_lbl}</td><td>{state_st}</td><td><span class="required">*</span></td></tr><tr><td width="100" align="right">{phone_st_lbl}</td><td>{phone_st}</td><td><span class="required">*</span></td></tr><tr><td colspan="3">{extra_field_st_start} <table border="0"><tbody><tr><td>{extra_field_st}</td></tr></tbody></table>{extra_field_st_end}</td></tr></tbody></table>'; } if (!isset($post["phone_ST"]) || $post["phone_ST"] == 0) { $post["phone_ST"] = ''; } $allowCustomer = ''; $allowCompany = ''; if ($is_company == 1) { $allowCustomer = 'style="display:none;"'; } else { $allowCompany = 'style="display:none;"'; } $read_only = ""; $countryarray = $Redconfiguration->getCountryList(@$post, "country_code_ST", "ST", "inputbox billingRequired valid"); $post['country_code_ST'] = $countryarray['country_code_ST']; $lists['country_code_ST'] = $countryarray['country_dropdown']; $statearray = $Redconfiguration->getStateList(@$post, "state_code_ST", "country_code_ST", "ST", 0, ""); $lists['state_code_ST'] = $statearray['state_dropdown']; $countrystyle = count($countryarray['countrylist']) == 1 && count($statearray['statelist']) == 0 ? 'display:none;' : ''; $statestyle = $statearray['is_states'] <= 0 ? 'display:none;' : ''; $template_desc = str_replace("{firstname_st_lbl}", JText::_('COM_REDSHOP_FIRSTNAME'), $template_desc); $template_desc = str_replace("{firstname_st}", '<input class="inputbox billingRequired valid" type="text" name="firstname_ST" id="firstname_ST" size="32" maxlength="250" value="' . @$post["firstname_ST"] . '" />', $template_desc); $template_desc = str_replace("{lastname_st_lbl}", JText::_('COM_REDSHOP_LASTNAME'), $template_desc); $template_desc = str_replace("{lastname_st}", '<input class="inputbox billingRequired valid" type="text" name="lastname_ST" id="lastname_ST" size="32" maxlength="250" value="' . @$post["lastname_ST"] . '" />', $template_desc); $template_desc = str_replace("{address_st_lbl}", JText::_('COM_REDSHOP_ADDRESS'), $template_desc); $template_desc = str_replace("{address_st}", '<input class="inputbox billingRequired valid" type="text" name="address_ST" id="address_ST" size="32" maxlength="250" value="' . @$post["address_ST"] . '" />', $template_desc); $template_desc = str_replace("{zipcode_st_lbl}", JText::_('COM_REDSHOP_ZIP'), $template_desc); $template_desc = str_replace("{zipcode_st}", '<input class="inputbox billingRequired valid zipcode" type="text" name="zipcode_ST" id="zipcode_ST" size="32" maxlength="10" value="' . @$post['zipcode_ST'] . '" onblur="return autoFillCity(this.value,\'ST\');" />', $template_desc); $template_desc = str_replace("{city_st_lbl}", JText::_('COM_REDSHOP_CITY'), $template_desc); $template_desc = str_replace("{city_st}", '<input class="inputbox billingRequired valid" type="text" name="city_ST" ' . $read_only . ' id="city_ST" value="' . @$post['city_ST'] . '" size="32" maxlength="250" />', $template_desc); $template_desc = str_replace("{phone_st_lbl}", JText::_('COM_REDSHOP_PHONE'), $template_desc); $template_desc = str_replace("{phone_st}", '<input class="inputbox billingRequired valid phone" type="text" name="phone_ST" id="phone_ST" size="32" maxlength="250" value="' . @$post["phone_ST"] . '" onblur="return searchByPhone(this.value,\'ST\');" />', $template_desc); $template_desc = str_replace("{country_st_txtid}", "div_country_st_txt", $template_desc); $template_desc = str_replace("{country_st_style}", $countrystyle, $template_desc); $template_desc = str_replace("{state_st_txtid}", "div_state_st_txt", $template_desc); $template_desc = str_replace("{state_st_style}", $statestyle, $template_desc); $template_desc = str_replace("{country_st_lbl}", JText::_('COM_REDSHOP_COUNTRY'), $template_desc); $template_desc = str_replace("{country_st}", $lists['country_code_ST'], $template_desc); $template_desc = str_replace("{state_st_lbl}", JText::_('COM_REDSHOP_STATE'), $template_desc); $template_desc = str_replace("{state_st}", $lists['state_code_ST'], $template_desc); if (strstr($template_desc, "{extra_field_st_start}") && strstr($template_desc, "{extra_field_st_end}")) { $template_pd_sdata = explode('{extra_field_st_start}', $template_desc); $template_pd_edata = explode('{extra_field_st_end}', $template_pd_sdata[1]); $template_middle = $template_pd_edata[0]; $extra_field_company = ALLOW_CUSTOMER_REGISTER_TYPE != 1 && $lists['shipping_company_field'] != "" ? $lists['shipping_company_field'] : ""; $extra_field_user = ALLOW_CUSTOMER_REGISTER_TYPE != 2 && $lists['shipping_customer_field'] != "" ? $lists['shipping_customer_field'] : ""; $template_middle_company = str_replace("{extra_field_st}", $extra_field_company, $template_middle); $template_middle_user = str_replace("{extra_field_st}", $extra_field_user, $template_middle); $template_middle_company = '<div id="exCompanyFieldST" ' . $allowCompany . '>' . $template_middle_company . '</div>'; $template_middle_user = '******' . $allowCustomer . '>' . $template_middle_user . '</div>'; $template_desc = $template_pd_sdata[0] . $template_middle_company . $template_middle_user . $template_pd_edata[1]; } return $template_desc; }