Skip to main content
clafiry my need
Source Link
PЯINCƎ
  • 11.7k
  • 3
  • 26
  • 82

I have some notice in a line 27 of the method bellow, and can't find the issue !

public function blockOrder()
{
    $items = Mage::getSingleton('checkout/cart')->getQuote()->getItemsCollection();
    $tab = array();
    foreach ($items as $itemCart) {
    /*line 27*/
        $tab[$itemCart->getUdropshipVendor()] += $itemCart->getPrice() * $itemCart->getQty();
    }
 
    foreach ($tab as $vendorId => $amountInCart) {
        $vendorMinAmount = Mage::getModel('udropship/vendor')->load($vendorId)->getMinimumOrderAmount();
        if ($amountInCart < $vendorMinAmount) {
            return true;
        }
        return false;
    }
}

I have some notice in a line 27 of the method bellow, and can't find the issue !

public function blockOrder()
{
    $items = Mage::getSingleton('checkout/cart')->getQuote()->getItemsCollection();
    $tab = array();
    foreach ($items as $itemCart) {
    /*line 27*/
        $tab[$itemCart->getUdropshipVendor()] += $itemCart->getPrice() * $itemCart->getQty();
    }
 
    foreach ($tab as $vendorId => $amountInCart) {
        $vendorMinAmount = Mage::getModel('udropship/vendor')->load($vendorId)->getMinimumOrderAmount();
        if ($amountInCart < $vendorMinAmount) {
            return true;
        }
        return false;
    }
}

I have some notice in a line 27 of the method bellow, and can't find the issue !

public function blockOrder()
{
    $items = Mage::getSingleton('checkout/cart')->getQuote()->getItemsCollection();
    $tab = array();
    foreach ($items as $itemCart) {
    /*line 27*/ $tab[$itemCart->getUdropshipVendor()] += $itemCart->getPrice() * $itemCart->getQty();
    }
    foreach ($tab as $vendorId => $amountInCart) {
        $vendorMinAmount = Mage::getModel('udropship/vendor')->load($vendorId)->getMinimumOrderAmount();
        if ($amountInCart < $vendorMinAmount) {
            return true;
        }
        return false;
    }
}
edited title
Source Link
sv3n
  • 11.7k
  • 7
  • 41
  • 73

Notice: Undefined offset: 1, Undefined offset: 2 - Magento 1.9

I have some notice in a line 27 of the method bellow, and can't find the issue !

public function blockOrder()  
{
    $items = Mage::getSingleton('checkout/cart')->getQuote()->getItemsCollection();
    $tab = array();
        foreach ($items as $itemCart) {
    /*line 27*/
        $tab[$itemCart->getUdropshipVendor()] += $itemCart->getPrice() * $itemCart->getQty();
        }

        foreach ($tab as $vendorId => $amountInCart) {
            $vendorMinAmount = Mage::getModel('udropship/vendor')->load($vendorId)->getMinimumOrderAmount();
            if ($amountInCart < $vendorMinAmount) {
                return true;
            }
            return false;
        }
}

Notice: Undefined offset: 1, Undefined offset: 2 - Magento 1.9

I have some notice in a line 27 of the method bellow, and can't find the issue !

public function blockOrder() {
    $items = Mage::getSingleton('checkout/cart')->getQuote()->getItemsCollection();
    $tab = array();
        foreach($items as $itemCart){
/*line 27*/ $tab[$itemCart->getUdropshipVendor()] += $itemCart->getPrice() * $itemCart->getQty();
        }

        foreach ($tab as $vendorId => $amountInCart){
            $vendorMinAmount = Mage::getModel('udropship/vendor')->load($vendorId)->getMinimumOrderAmount();
            if ($amountInCart < $vendorMinAmount) {
                return true;
            }
            return false;
        }
}

Notice: Undefined offset: 1, Undefined offset: 2

I have some notice in a line 27 of the method bellow, and can't find the issue !

public function blockOrder() 
{
    $items = Mage::getSingleton('checkout/cart')->getQuote()->getItemsCollection();
    $tab = array();
    foreach ($items as $itemCart) {
    /*line 27*/
        $tab[$itemCart->getUdropshipVendor()] += $itemCart->getPrice() * $itemCart->getQty();
    }

    foreach ($tab as $vendorId => $amountInCart) {
        $vendorMinAmount = Mage::getModel('udropship/vendor')->load($vendorId)->getMinimumOrderAmount();
        if ($amountInCart < $vendorMinAmount) {
            return true;
        }
        return false;
    }
}
Source Link
PЯINCƎ
  • 11.7k
  • 3
  • 26
  • 82

Notice: Undefined offset: 1, Undefined offset: 2 - Magento 1.9

I have some notice in a line 27 of the method bellow, and can't find the issue !

public function blockOrder() {
    $items = Mage::getSingleton('checkout/cart')->getQuote()->getItemsCollection();
    $tab = array();
        foreach($items as $itemCart){
/*line 27*/ $tab[$itemCart->getUdropshipVendor()] += $itemCart->getPrice() * $itemCart->getQty();
        }

        foreach ($tab as $vendorId => $amountInCart){
            $vendorMinAmount = Mage::getModel('udropship/vendor')->load($vendorId)->getMinimumOrderAmount();
            if ($amountInCart < $vendorMinAmount) {
                return true;
            }
            return false;
        }
}