public function sGetDispatchBasket($article,
$countryID = null,
$paymentID = null
) { $sql_select = '';
if (!
empty($this->config->
get('sPREMIUMSHIPPIUNGASKETSELECT'
))) { $sql_select .= ', ' .
$this->config->
get('sPREMIUMSHIPPIUNGASKETSELECT'
);
} $sql = 'SELECT id, calculation_sql FROM s_premium_dispatch WHERE calculation=3';
$calculations =
$this->db->
fetchPairs($sql);
if (!
empty($calculations)) { foreach ($calculations as $dispatchID =>
$calculation) { if (empty($calculation)) { $calculation =
$this->db->
quote($calculation);
} $sql_select .= ', (' .
$calculation . ') as calculation_value_' .
$dispatchID;
} } $sql = "
SELECT
MIN(d.instock>=b.quantity) as instock,
MIN(d.instock>=(b.quantity+d.stockmin)) as stockmin,
MIN(d.laststock) as laststock,
SUM(d.weight*b.quantity) as weight,
SUM(IF(a.id,b.quantity,0)) as count_article,
MAX(b.shippingfree) as shippingfree,
SUM(IF(b.modus=0,b.quantity*b.price/b.currencyFactor,0)) as amount,
MAX(t.tax) as max_tax, u.id as userID