Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/sessions/model/_session.class.php on line 226

Warning: Cannot modify header information - headers already sent by (output started at /home/hendra/public_html/inc/sessions/model/_session.class.php:226) in /home/hendra/public_html/inc/sessions/model/_session.class.php on line 233

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 1151

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 907

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 1021

Warning: Cannot modify header information - headers already sent by (output started at /home/hendra/public_html/inc/sessions/model/_session.class.php:226) in /home/hendra/public_html/inc/_core/_template.funcs.php on line 59

Warning: Cannot modify header information - headers already sent by (output started at /home/hendra/public_html/inc/sessions/model/_session.class.php:226) in /home/hendra/public_html/inc/_core/_template.funcs.php on line 243

Warning: Cannot modify header information - headers already sent by (output started at /home/hendra/public_html/inc/sessions/model/_session.class.php:226) in /home/hendra/public_html/inc/_core/_template.funcs.php on line 244

Warning: Cannot modify header information - headers already sent by (output started at /home/hendra/public_html/inc/sessions/model/_session.class.php:226) in /home/hendra/public_html/inc/_core/_template.funcs.php on line 245

Warning: Cannot modify header information - headers already sent by (output started at /home/hendra/public_html/inc/sessions/model/_session.class.php:226) in /home/hendra/public_html/inc/_core/_template.funcs.php on line 246
Solve the huge data output problem from the Carrier::getDeliveryPriceByRanges function (Prestashop)
  • Home

  • Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 1151
  • Contact
  • Log in

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 1151

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 907

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 1021

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 1151

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 907

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 1021
« Definisi Teknologi Informasi Berdasarkan UU ITEMembuat Regex Secara Otomatis »


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 907

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 1021
Solve the huge data output problem from the Carrier::getDeliveryPriceByRanges function (Prestashop)


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 907

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 1021
16-10-2010 | by hendra [mail] | Categories: PHP, Programming

Link: http://www.prestashop.com/bug_tracker/view/5793/

Inside the Carrier::getDeliveryPriceByRanges function there are join processes between ps_range_weight table and ps_delivery table. If the ps_delivery table and ps_range_weight table have large amounts of data, the results of the join will produce an enormous data. This will cause the process stalled for some servers and we can not set the "Fees by carrier, geographical zone, and ranges".

To fix this, I modified the file: /admin/tabs/AdminShipping.php as follows:

This line:

$Delivery = Carrier::getDeliveryPriceByRanges($rangeTable);


I change to:

$Delivery = Carrier::getDeliveryPriceByRanges($rangeTable, $id_carrier);


After that I modified the file: /classes/Carrier.php as follows:

The function:

    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');
    }



I change to:

    public static function getDeliveryPriceByRanges($rangeTable, $id_carrier)
    {
        $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 AND d.`id_carrier` = '.$id_carrier.')
        ORDER BY r.`delimiter1` ASC');
    }



Please Prestashop team to check this.


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 907

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 1021

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 907

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 1021
Permalink

Trackback address for this post

This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

No feedback yet

Leave a comment


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 907

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/_core/_misc.funcs.php on line 1021

Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/sessions/model/_hit.class.php on line 952

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/sessions/model/_session.class.php on line 451

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/sessions/model/_hitlist.class.php on line 127

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead in /home/hendra/public_html/inc/sessions/model/_hitlist.class.php on line 127