public function addAction() { Mage::log('debug : *** addAction'); $_product = $this->processProduct(); $cart = $this->_getCart(); $tokens = SpectrumProductProcessor::getImageProcessingType($_product); if (count($tokens) > 0) { foreach ($tokens as $token) { Mage::log('processing token = ' . $token); if ($token != "" && $token != "None" && $token != "none") { SpectrumProductProcessor::addProcessingProductToCart($token, $cart); $this->_getSession()->addSuccess($token . " was added to your shopping cart."); } else { Mage::log("SKU : " . $_product->getSku() . " requires no image processing"); } } } else { Mage::log("SKU : " . $_product->getSku() . " requires no image processing"); } $cart = $this->_getCart(); if ($this->processRedrawingOption($_product)) { Mage::log("REDRAWING REQUIRED"); $id = Mage::getModel('catalog/product')->getIdBySku("artwork-redrawing-fee"); if ($id) { $cart->addProductsByIDs(array($id)); $message = $this->__('Artwork redrawing fee was added to your shopping cart.'); $this->_getSession()->addSuccess($message); } else { Mage::log("Unable to locate artwork redrawing fee product"); } } if ($this->processOption($_product, "Rush Order Surcharge (If order is required in less than 10 days please apply.)", "Yes Please")) { Mage::log("RUSH ORDER SURCHARGE REQUIRED"); $id = Mage::getModel('catalog/product')->getIdBySku("rush-order-surcharge"); if ($id) { $cart->addProductsByIDs(array($id)); $message = $this->__('Rush order surcharge fee was added to your shopping cart.'); $this->_getSession()->addSuccess($message); } else { Mage::log("Unable to locate rush order surcharge product"); } } if ($this->processOption($_product, "2nd Poll Printing", "Yes Please")) { Mage::log("2nd poll printing REQUIRED"); $id = Mage::getModel('catalog/product')->getIdBySku("2nd-poll-printing-surcharge"); if ($id) { $cart->addProductsByIDs(array($id)); $message = $this->__('2nd poll printing fee was added to your shopping cart.'); $this->_getSession()->addSuccess($message); } else { Mage::log("Unable to locate 2nd poll printing surcharge product"); } } $cart->removeItem($_product->getId())->save(); parent::addAction(); }