Opencart – restrict payment and shipping methods based on products weight

  1. Restrict payment method (for example Cash on Delivery) if product weight is above 1 kg (or any other default unit)
    IN:
    /catalog/model/payment/cod.php
    
    AFTER:
    public function getMethod($address, $total) {
    
    ADD:
    if ($this->cart->getWeight() > 1) return;
  2. Restrict shipping method, for example, disable Weight Based Shipping if weight is less than 1 kg:
    IN:
    catalog/model/shipping/weight.php
    
    BEFORE: if ($status) {
    
    ADD: if ($this->cart->getWeight() < 1) {$status = false;}

Sources: https://forum.opencart.com/viewtopic.php?t=50670
and https://forum.opencart.com/viewtopic.php?t=171963