cernicektomas Posted September 9, 2016 Share Posted September 9, 2016 Zdravím, PrestaShop má v základu možnost omezit dopravce dle Maximální hmotnost zásilky. Potřeboval bych z určitých důvodů nastavit naopak Minimální povolenou hmotnost (místo Maximální). Poraďte prosím jak a kde změnit v kódu. Šlo by to nějak. Děkuji za tipy. Tomáš Link to comment Share on other sites More sharing options...
[email protected] Posted September 26, 2016 Share Posted September 26, 2016 Ahoj, myslím si, že to jde omezit přímo v nastavení konkrétního dopravce a to tak, že se nastaví rozsah od váhy která je požadována a pokud váha zboží nedosáhne požadované výše, tak se dopravce nezobrazí, pokud je zaškrtnuta volba nezobrazovat pokud je váha mimo rozsah. Chce to vyzkoušet. Link to comment Share on other sites More sharing options...
cernicektomas Posted September 26, 2016 Author Share Posted September 26, 2016 Řešení již poskytnu na anglickém fóru a funguje: It seems there's only one place that variable is used, so I should be easy to change. It's the following code on line 1413 of classes/Carrier.php: if ($carrier->max_weight > 0 && ($carrier->max_weight < $product->weight * $cart_quantity || $carrier->max_weight < $cart_weight)) { You can try changing it to: if ($carrier->max_weight > 0 && ($carrier->max_weight > $product->weight * $cart_quantity || $carrier->max_weight > $cart_weight)) { It's better to do this using an override so PrestaShop won't overwrite your code during an upgrade. Create override/classes/Carrier.php like this: <?phpclass Carrier extends CarrierCore{// Paste your getAvailableCarrierList function here with the changed line} Remember to go to the Advanced Parameters > Performance tab and click the "Clear cache" button (or manually delete cache/class_index.php) so PrestaShop can find the override. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now