Jump to content

Harga/kg Gak Berubah Ketika Sudah Lebih Dari 1 Kg


zakidd

Recommended Posts

By default Prestashop menghitung ongkos kirim berdasarkan Range-Weight yang dibuat

kalau hanya mengatur range weight 0-1Kg dan setting Shipping fee utk range weight tsb maka Ongkir tidak akan otomatis dikalikan per kelipatan berat.

 

Solusinya :

  1. Buat range weight sesuai kebutuhan, atau
  2. Cukup buat range-weight 0-1Kg tapi kamu harus memmodifikasi (override) classes file Carrier.php
    function getDeliveryPriceByWeight

  • Like 1
Link to comment
Share on other sites

tq mod dah sukses u ps 1.5.3 yang mo coba ini clunya sukses di ane

 

 

self::$price_by_weight[$cache_key] = $this->getMaxDeliveryPriceByWeight($id_zone)* ceil($total_weight);

else

self::$price_by_weight[$cache_key] = $result['price']* ceil($total_weight);

 

teamshop

Edited by zakidd (see edit history)
  • Like 1
Link to comment
Share on other sites

tq mod dah sukses u ps 1.5.3 yang mo coba ini clunya sukses di ane

 

 

self::$price_by_weight[$cache_key] = $this->getMaxDeliveryPriceByWeight($id_zone)* ceil($total_weight);

else

self::$price_by_weight[$cache_key] = $result['price']* ceil($total_weight);

 

teamshop

 

Share mas bro,..biar manfaat jg sama yg lain..

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

di dalam folder class ada carrier.php, edit dengan text editor cari baris 227 ada fuction getDeliveryPriceByWeight($total_weight, $id_zone), tambahkan * ceil($total_weight) di baris 243 dan 245, ni script function setelah di ubah :

 

public function getDeliveryPriceByWeight($total_weight, $id_zone)

{

$cache_key = $this->id.'_'.$total_weight.'_'.$id_zone;

if (!isset(self::$price_by_weight[$cache_key]))

{

$sql = 'SELECT d.`price`

FROM `'._DB_PREFIX_.'delivery` d

LEFT JOIN `'._DB_PREFIX_.'range_weight` w ON (d.`id_range_weight` = w.`id_range_weight`)

WHERE d.`id_zone` = '.(int)$id_zone.'

AND '.(float)$total_weight.' >= w.`delimiter1`

AND '.(float)$total_weight.' < w.`delimiter2`

AND d.`id_carrier` = '.(int)$this->id.'

'.Carrier::sqlDeliveryRangeShop('range_weight').'

ORDER BY w.`delimiter1` ASC';

$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);

if (!isset($result['price']))

self::$price_by_weight[$cache_key] = $this->getMaxDeliveryPriceByWeight($id_zone) * ceil($total_weight);

else

self::$price_by_weight[$cache_key] = $result['price'] * ceil($total_weight);

}

return self::$price_by_weight[$cache_key];

}

 

utk versi 1.5.4

utk versi 1.4.xx beda

Link to comment
Share on other sites

  • 1 month later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...