Beispiel #1
0
 /**
  * Returns a selectlist of zones
  * Called via Ajax
  * 
  * @return unknown_type
  */
 function getZones()
 {
     Tienda::load('TiendaSelect', 'library.select');
     $html = '';
     $text = '';
     $country_id = JRequest::getVar('country_id');
     $name = JRequest::getVar('name', 'zone_id');
     if (empty($country_id)) {
         $html = JText::_('COM_TIENDA_SELECT_COUNTRY_FIRST');
     } else {
         $html = TiendaSelect::zone('', $name, $country_id);
     }
     $response = array();
     $response['msg'] = $html;
     $response['error'] = '';
     // encode and echo (need to echo to send back to browser)
     echo json_encode($response);
     return;
 }
Beispiel #2
0
 /**
  * 
  * @return unknown_type
  */
 function filterZones()
 {
     JLoader::import('com_tienda.library.json', JPATH_ADMINISTRATOR . '/components');
     Tienda::load('TiendaSelect', 'library.select');
     $idtag = 'zone_id';
     $countryid = JRequest::getVar('countryid', '', 'request', 'int');
     $idprefix = JRequest::getVar('idprefix', '', 'request');
     if (count($idprefix) > 0) {
         $idtag = $idprefix . $idtag;
     }
     $url = "index.php?option=com_tienda&format=raw&controller=zones&task=addZone&geozoneid=";
     $attribs = array('class' => 'inputbox', 'size' => '1');
     $hookgeozone = JRequest::getVar('hookgeozone', TRUE, 'request', 'boolean');
     if ($hookgeozone) {
         $attribs['onchange'] = 'tiendaDoTask( \'' . $url . '\'+document.getElementById(\'geozone_id\').value+\'&zoneid=\'+this.options[this.selectedIndex].value, \'current_zones_wrapper\', \'\');';
     }
     $html = TiendaSelect::zone('', $idtag, $countryid, $attribs, $idtag, true);
     // set response array
     $response = array();
     $response['msg'] = $html;
     // encode and echo (need to echo to send back to browser)
     echo json_encode($response);
     return;
 }
Beispiel #3
0
?>
				</td>
			</tr>
			<tr>
				<th style="width: 100px; text-align: right;" class="key">
				<?php 
echo JText::_('ZONE');
?>
				</th>
				<td>
				<div id="zones_wrapper">
					<?php 
if (empty($row->zone_id)) {
    echo JText::_("SELECT COUNTRY FIRST");
} else {
    echo TiendaSelect::zone($row->zone_id, 'zone_id', $row->country_id);
}
?>
				</div>
				</td>
			</tr>
			<tr>
				<th style="width: 100px; text-align: right;" class="key">
				<?php 
echo JText::_('POSTAL CODE');
?>
				</th>
				<td>
				<input type="text" name="postal_code"
				id="postal_code" size="25" maxlength="250"
				value="<?php 
Beispiel #4
0
 /**
  * Gets an address form for display
  *
  * @param string $prefix
  * @return string html
  */
 function getAddressForm($prefix, $guest = false, $forShipping = false)
 {
     $html = '';
     $model = $this->getModel('addresses', 'TiendaModel');
     $view = $this->getView($this->get('suffix'), 'html');
     $view->set('_controller', $this->get('suffix'));
     $view->set('_view', $this->get('suffix'));
     $view->set('_doTask', true);
     $view->set('hidemenu', true);
     $view->set('form_prefix', $prefix);
     $view->set('guest', $guest);
     $view->setLayout('form_address');
     // Checking whether shipping is required
     $showShipping = false;
     $cartsModel = $this->getModel('carts');
     if ($isShippingEnabled = $cartsModel->getShippingIsEnabled()) {
         $showShipping = true;
     }
     $view->assign('showShipping', $showShipping);
     $view->assign('forShipping', $forShipping);
     JModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tienda/models');
     $countries_model = JModel::getInstance('Countries', 'TiendaModel');
     $default_country = $countries_model->getDefault();
     $default_country_id = $default_country->country_id;
     $attribs = array('class' => 'inputbox', 'size' => '1');
     if ($this->onepage_checkout) {
         //$attribs['onchange'] = 'tiendaCheckoutAutomaticShippingRatesUpdate( \''.$prefix.'zone_id\', \''.JText::_('COM_TIENDA_UPDATING_SHIPPING_RATES').'\', \''.JText::_('COM_TIENDA_UPDATING_CART').'\', \''.JText::_('COM_TIENDA_UPDATING_ADDRESS').'\', \''.JText::_('COM_TIENDA_UPDATING_PAYMENT_METHODS').'\' ); ';
     }
     Tienda::load('TiendaSelect', 'library.select');
     $zones = TiendaSelect::zone('', $prefix . 'zone_id', $default_country_id, $attribs, $prefix . 'zone_id');
     $view->assign('default_country_id', $default_country_id);
     $view->assign('zones', $zones);
     $html = $view->loadTemplate();
     return $html;
 }
Beispiel #5
0
                </td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;" class="key">
                    <?php 
echo JText::_('COM_TIENDA_ZONE');
?>
:
                </td>
                <td>
                    <div id="shipping_zones_wrapper">
                        <?php 
if (empty($row->orderinfo->shipping_zone_id)) {
    echo JText::_('COM_TIENDA_SELECT_COUNTRY_FIRST');
} else {
    echo TiendaSelect::zone($row->orderinfo->shipping_zone_id, 'shipping_zone_id', @$row->orderinfo->shipping_country_id);
}
?>
                    </div>
                </td>
            </tr>
        </table>
    </fieldset>

    <input type="hidden" name="id" value="<?php 
echo @$row->order_id;
?>
" />
    <input type="hidden" name="task" id="task" value="saveAddresses" />
</form>
Beispiel #6
0
                                                </td>
                                                <td></td>
                                            </tr>
                                            <tr>
                                                <th style="width: 25%;"><?php 
echo JText::_('COM_TIENDA_STATE_REGION');
?>
                                                </th>
                                                <td>
                                                    <div id="zones_wrapper">
                                                        <?php 
$shop_zone = $this->row->get('shop_zone', '');
if (empty($shop_zone)) {
    echo JText::_('COM_TIENDA_SELECT_COUNTRY_FIRST');
} else {
    echo TiendaSelect::zone($shop_zone, 'shop_zone', $this->row->get('shop_country', ''));
}
?>
                                                    </div>
                                                </td>
                                                <td></td>
                                            </tr>
                                            <tr>
                                                <th style="width: 25%;"><?php 
echo JText::_('COM_TIENDA_POSTAL_CODE');
?>
                                                </th>
                                                <td><input type="text" name="shop_zip" value="<?php 
echo $this->row->get('shop_zip', '');
?>
" />
Beispiel #7
0
		<?php 
if ($elements['zone'][0]) {
    ?>
		<div class="control-group">
			<label class="key">
				<?php 
    echo JText::_('COM_TIENDA_STATE_PROVINCE');
    ?>
			</label>
			<div id="<?php 
    echo $this->form_prefix;
    ?>
zones_wrapper">
				<?php 
    $attribs = array('class' => 'required', 'size' => '1');
    echo TiendaSelect::zone('', $this->form_prefix . 'zone_id', $this->default_country_id, $attribs, $this->form_prefix . 'zone_id');
    ?>
			</div>
		</div>
		<?php 
}
?>
    
    	<?php 
if ($elements['zip'][0]) {
    ?>
		<div class="control-group">
			<label for="<?php 
    echo $this->form_prefix;
    ?>
postal_code">
Beispiel #8
0
 /**
  * Returns a selectlist of zones
  * Called via Ajax
  *
  * @return unknown_type
  */
 function getZones()
 {
     Tienda::load('TiendaSelect', 'library.select');
     $html = '';
     $text = '';
     $country_id = JRequest::getVar('country_id');
     $prefix = JRequest::getVar('prefix');
     $html = TiendaSelect::zone('', $prefix . 'zone_id', $country_id);
     $response = array();
     $response['msg'] = $html;
     $response['error'] = '';
     // encode and echo (need to echo to send back to browser)
     echo json_encode($response);
     return;
 }
Beispiel #9
0
 /**
  * Returns a selectlist of zones
  * Called via Ajax
  *
  * @return unknown_type
  */
 function getZones()
 {
     Tienda::load('TiendaSelect', 'library.select');
     $html = '';
     $text = '';
     $country_id = JRequest::getVar('country_id');
     $prefix = JRequest::getVar('prefix');
     $html = TiendaSelect::zone('', $prefix . 'zone_id', $country_id, array('class' => 'inputbox', 'size' => '1'), $prefix . 'zone_id', true);
     $response = array();
     $response['msg'] = $html;
     $response['error'] = '';
     return json_encode($response);
 }