// Merge -> 8910
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -25,7 +25,6 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
|
||||
class AdminShipping extends AdminTab
|
||||
{
|
||||
private $_fieldsHandling;
|
||||
@@ -92,7 +91,7 @@ class AdminShipping extends AdminTab
|
||||
{
|
||||
/* Get configuration values */
|
||||
$shipping_method = $carrier->getShippingMethod();
|
||||
$rangeTable = $carrier->getRangeTable();
|
||||
$rangeTable = $carrier->getRangeTable();
|
||||
|
||||
$carrier->deleteDeliveryPrice($rangeTable);
|
||||
$currentList = Carrier::getDeliveryPriceByRanges($rangeTable, $id_carrier);
|
||||
@@ -104,7 +103,7 @@ class AdminShipping extends AdminTab
|
||||
{
|
||||
$tmpArray = explode('_', $key);
|
||||
|
||||
$price = number_format(abs(str_replace(',', '.', $value)), 2, '.', '');
|
||||
$price = number_format(abs(str_replace(',', '.', $value)), 6, '.', '');
|
||||
$current = 0;
|
||||
foreach ($currentList as $item)
|
||||
if ($item['id_zone'] == $tmpArray[1] && $item['id_'.$rangeTable] == $tmpArray[2])
|
||||
@@ -115,8 +114,8 @@ class AdminShipping extends AdminTab
|
||||
$priceList[] = array(
|
||||
'id_range_price' => ($shipping_method == Carrier::SHIPPING_METHOD_PRICE) ? (int)$tmpArray[2] : null,
|
||||
'id_range_weight' => ($shipping_method == Carrier::SHIPPING_METHOD_WEIGHT) ? (int)$tmpArray[2] : null,
|
||||
'id_carrier' => (int)$carrier->id,
|
||||
'id_zone' => (int)$tmpArray[1],
|
||||
'id_carrier' => (int)$carrier->id,
|
||||
'id_zone' => (int)$tmpArray[1],
|
||||
'price' => $price,
|
||||
);
|
||||
}
|
||||
@@ -218,13 +217,13 @@ class AdminShipping extends AdminTab
|
||||
$id_carrier = (int)$carrierArray[0]['id'];
|
||||
$carrierSelected = new Carrier($id_carrier);
|
||||
}
|
||||
|
||||
|
||||
echo '<br /><br />
|
||||
<h2>'.$this->l('Fees by carrier, geographical zone, and ranges').'</h2>
|
||||
<form action="'.self::$currentIndex.'&token='.$this->token.'" id="fees" name="fees" method="post">
|
||||
<fieldset>
|
||||
<legend><img src="../img/admin/delivery.gif" />'.$this->l('Fees').'</legend>';
|
||||
|
||||
|
||||
if (!count($carrierArray))
|
||||
echo $this->l('You only have free carriers, there is no need to configure your delivery prices.');
|
||||
else
|
||||
@@ -266,7 +265,7 @@ class AdminShipping extends AdminTab
|
||||
echo '<td class="center">'.$currency->getSign('left').'<input type="text" id="fees_all_'.$range[$rangeIdentifier].'" onchange="this.value = this.value.replace(/,/g, \'.\');" onkeyup="if ((event.keyCode||event.which) != 9){ spreadFees('.$range[$rangeIdentifier].') }" style="width: 45px;" />'.$currency->getSign('right').'</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
|
||||
foreach ($zones AS $zone)
|
||||
{
|
||||
echo '
|
||||
@@ -284,7 +283,7 @@ class AdminShipping extends AdminTab
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo '<tr>
|
||||
<td colspan="'.(sizeof($ranges) + 1).'" class="center" style="border-bottom: none; height: 40px;">
|
||||
<input type="hidden" name="submitFees'.$this->table.'" value="1" />';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -31,27 +31,27 @@ class AdminStores extends AdminTab
|
||||
{
|
||||
/** @var array countries list */
|
||||
private $countriesArray = array();
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->context = Context::getContext();
|
||||
$this->context = Context::getContext();
|
||||
$this->table = 'store';
|
||||
$this->className = 'Store';
|
||||
$this->lang = false;
|
||||
$this->edit = true;
|
||||
$this->delete = true;
|
||||
|
||||
|
||||
$this->fieldImageSettings = array('name' => 'image', 'dir' => 'st');
|
||||
|
||||
|
||||
$this->_select = 'cl.`name` country, st.`name` state';
|
||||
$this->_join = '
|
||||
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (cl.`id_country` = a.`id_country` AND cl.`id_lang` = '.(int)$this->context->language->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'state` st ON (st.`id_state` = a.`id_state`)';
|
||||
|
||||
|
||||
$countries = Country::getCountries($this->context->language->id);
|
||||
foreach ($countries AS $country)
|
||||
$this->countriesArray[$country['id_country']] = $country['name'];
|
||||
|
||||
|
||||
$this->fieldsDisplay = array(
|
||||
'id_store' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||
'country' => array('title' => $this->l('Country'), 'width' => 100, 'filter_key' => 'cl!name'),
|
||||
@@ -78,7 +78,7 @@ class AdminStores extends AdminTab
|
||||
);
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
protected function postImage($id)
|
||||
{
|
||||
$ret = parent::postImage($id);
|
||||
@@ -90,14 +90,14 @@ class AdminStores extends AdminTab
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
public function displayOptionsList()
|
||||
{
|
||||
parent::displayOptionsList();
|
||||
|
||||
|
||||
echo '<br /><p><img src="../img/admin/asterisk.gif" class="middle" /> '.$this->l('You can also replace the icon representing your store in Google Maps. Go to the Preferences tab, and then the Appearance subtab.').'</p>';
|
||||
}
|
||||
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (isset($_POST['submitAdd'.$this->table]))
|
||||
@@ -152,11 +152,11 @@ class AdminStores extends AdminTab
|
||||
if (!sizeof($this->_errors))
|
||||
parent::postProcess();
|
||||
}
|
||||
|
||||
|
||||
public function displayForm($isMainTab = true)
|
||||
{
|
||||
parent::displayForm();
|
||||
|
||||
|
||||
if (!($obj = $this->loadObject(true)))
|
||||
return;
|
||||
echo '
|
||||
@@ -234,7 +234,7 @@ class AdminStores extends AdminTab
|
||||
</div>
|
||||
<label>'.$this->l('Latitude / Longitude:').'</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="8" maxlength="10" name="latitude" value="'.htmlentities($this->getFieldValue($obj, 'latitude'), ENT_COMPAT, 'UTF-8').'" onKeyUp="javascript:this.value = this.value.replace(/,/g, \'.\');" /> / <input type="text" size="8" maxlength="10" name="longitude" value="'.htmlentities($this->getFieldValue($obj, 'longitude'), ENT_COMPAT, 'UTF-8').'" onKeyUp="javascript:this.value = this.value.replace(/,/g, \'.\');" />
|
||||
<input type="text" size="11" maxlength="12" name="latitude" value="'.htmlentities($this->getFieldValue($obj, 'latitude'), ENT_COMPAT, 'UTF-8').'" onKeyUp="javascript:this.value = this.value.replace(/,/g, \'.\');" /> / <input type="text" size="11" maxlength="12" name="longitude" value="'.htmlentities($this->getFieldValue($obj, 'longitude'), ENT_COMPAT, 'UTF-8').'" onKeyUp="javascript:this.value = this.value.replace(/,/g, \'.\');" />
|
||||
<sup>*</sup>
|
||||
<p class="clear">'.$this->l('Store coords, eg. 45.265469 / -47.226478').'</p>
|
||||
</div>
|
||||
@@ -270,7 +270,7 @@ class AdminStores extends AdminTab
|
||||
<p class="clear">'.$this->l('Store window picture').'</p>';
|
||||
|
||||
echo $this->displayImage($obj->id, _PS_STORE_IMG_DIR_.'/'.$obj->id.'.jpg', 350, NULL, Tools::getAdminToken('AdminStores'.(int)(Tab::getIdFromClassName('AdminStores')).(int)$this->context->employee->id), true);
|
||||
|
||||
|
||||
echo '</div>
|
||||
<table cellpadding="2" cellspacing="2" style="padding: 10px; margin-top: 15px; border: 1px solid #BBB;">
|
||||
<tr>
|
||||
@@ -280,7 +280,7 @@ class AdminStores extends AdminTab
|
||||
<td> </td>
|
||||
<td style="font-size: 0.85em;">'.$this->l('Sample: 10:00AM - 9:30PM').'</td>
|
||||
</tr>';
|
||||
|
||||
|
||||
$days = array();
|
||||
$days[1] = $this->l('Monday');
|
||||
$days[2] = $this->l('Tuesday');
|
||||
@@ -289,11 +289,11 @@ class AdminStores extends AdminTab
|
||||
$days[5] = $this->l('Friday');
|
||||
$days[6] = $this->l('Saturday');
|
||||
$days[7] = $this->l('Sunday');
|
||||
|
||||
|
||||
$hours = $this->getFieldValue($obj, 'hours');
|
||||
if (!empty($hours))
|
||||
$hoursUnserialized = unserialize($hours);
|
||||
|
||||
|
||||
for ($i = 1; $i < 8; $i++)
|
||||
echo '
|
||||
<tr style="color: #7F7F7F; font-size: 0.85em;">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user