Example #1
0
File: Cart.php Project: kingsj/core
 /**
  * Return product options that are requested to add to cart with a provided product.
  *
  * @param \XLite\Model\Product $product Product class that is requested to add to cart
  *
  * @return array
  */
 protected function getCurrentProductOptions(\XLite\Model\Product $product)
 {
     if (isset(\XLite\Core\Request::getInstance()->product_options)) {
         $options = $product->prepareOptions(\XLite\Core\Request::getInstance()->product_options);
         if (!$product->checkOptionsException($options)) {
             $options = null;
         }
     } else {
         $options = $product->getDefaultProductOptions();
     }
     return $options;
 }