Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. Function checkQuoteItemQty :
  2.  
  3. if (!$this->checkQty($summaryQty) || !$this->checkQty($qty)) {
  4. //$message = Mage::helper('cataloginventory')->__('The requested quantity for "%s" is not available.', $this->getProductName());
  5. $message = Mage::helper('cataloginventory')->__('The requested quantity for "%s" is not available (max:%s).', $this->getProductName(), ($this->getQty() * 1));
  6. $cat_id = $this->getProduct()->getCategoryIds();
  7. if($cat_id){
  8. $url = Mage::getModel('catalog/category')->load($cat_id[0])->getUrl();
  9. $message .= Mage::helper('cataloginventory')->__('You might be interested in <a href="%s">those products</a>.', $url);
  10. }
  11. $result->setHasError(true)
  12. ->setMessage($message)
  13. ->setQuoteMessage($message)
  14. ->setQuoteMessageIndex('qty');
  15. return $result;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement