Example #1
0
 public function validateSubscription(AW_Sarp_Model_Catalog_Product $product, Varien_Object $buyRequest)
 {
     if ($options = $buyRequest->getOptions()) {
         if (!isset($options['aw_sarp_subscription_start']) && !in_array(AW_Sarp_Model_Period::PERIOD_TYPE_NONE, explode(',', $product->getAwSarpPeriod()))) {
             if (!$buyRequest->getAwSarpSubscriptionStart()) {
                 return false;
             } else {
                 return true;
             }
         } else {
             return true;
         }
     }
     if (!$buyRequest->getAwSarpSubscriptionStart() && $buyRequest->getAwSarpSubscriptionStart() != '' && !in_array(AW_Sarp_Model_Period::PERIOD_TYPE_NONE, explode(',', $product->getAwSarpPeriod()))) {
         return false;
     } else {
         return true;
     }
 }