Nikt nic nie poradzi??? w pliku carrier.php mam taki fragment w którym trzeba pewnie pogrzebać, może ktoś mi pomoże. Mam moduł shipTOpay i pewnie on namieszał...
/**
* Get delivery prices for a given order
*
* @param floatval $orderTotal Order total to pay
* @param integer $id_zone Zone id (for customer delivery address)
* @return float Delivery price
*/
public function getDeliveryPriceByPrice($orderTotal, $id_zone)
{
if (isset(self::$priceByPrice[$this->id]))
return self::$priceByPrice[$this->id];
$result = Db::getInstance()->getRow('
SELECT d.`price`
FROM `'._DB_PREFIX_.'delivery` d
LEFT JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price`
WHERE d.`id_zone` = '.intval($id_zone).'
AND '.floatval($orderTotal).' >= r.`delimiter1`
AND '.floatval($orderTotal).' < r.`delimiter2`
AND d.`id_carrier` = '.intval($this->id).'
ORDER BY r.`delimiter1` ASC');
if (!isset($result['price']))
return $this->getMaxDeliveryPriceByPrice($id_zone);
return $result['price'];
}
static public function checkDeliveryPriceByPrice($id_carrier, $orderTotal, $id_zone)
{
$result = Db::getInstance()->getRow('
SELECT d.`price`
FROM `'._DB_PREFIX_.'delivery` d
LEFT JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price`
WHERE d.`id_zone` = '.intval($id_zone).'
AND '.floatval($orderTotal).' >= r.`delimiter1`
AND '.floatval($orderTotal).' < r.`delimiter2`
AND d.`id_carrier` = '.intval($id_carrier).'
ORDER BY r.`delimiter1` ASC');
if (!isset($result['price']))
return false;
return true;
}
public function getMaxDeliveryPriceByPrice($id_zone)
{
$result = Db::getInstance()->ExecuteS('
SELECT d.`price`
FROM `'._DB_PREFIX_.'delivery` d
INNER JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price`
WHERE d.`id_zone` = '.intval($id_zone).'
AND d.`id_carrier` = '.intval($this->id).'
ORDER BY r.`delimiter2` DESC LIMIT 1');
if (!isset($result[0]['price']))
return false;
return $result[0]['price'];
}
/**
* Get delivery prices for a given shipping method (price/weight)
*
* @param string $rangeTable Table name (price or weight)
* @return array Delivery prices
*/
public static function getDeliveryPriceByRanges($rangeTable)
{
$rangeTable = pSQL($rangeTable);
return Db::getInstance()->ExecuteS('
SELECT d.`id_'.$rangeTable.'`, d.`id_carrier`, d.`id_zone`, d.`price`
FROM `'._DB_PREFIX_.'delivery` d
LEFT JOIN `'._DB_PREFIX_.$rangeTable.'` r ON r.`id_'.$rangeTable.'` = d.`id_'.$rangeTable.'`
WHERE (d.`id_'.$rangeTable.'` IS NOT NULL AND d.`id_'.$rangeTable.'` != 0)
ORDER BY r.`delimiter1` ASC');