public function check_amz_multiple_cart() { $amz_cross_sell = isset($_GET['amz_cross_sell']) ? $_GET['amz_cross_sell'] : false; if ($amz_cross_sell != false) { $asins = isset($_GET['asins']) ? $_GET['asins'] : ''; if (trim($asins) != "") { $asins = explode(',', $asins); if (count($asins) > 0) { $amazon_settings = $this->getAllSettings('array', 'amazon'); $GLOBALS['AmazonWooCommerce'] = $this; // load the amazon webservices client class require_once $this->cfg['paths']['plugin_dir_path'] . '/lib/scripts/amazon/aaAmazonWS.class.php'; // create new amazon instance $aaAmazonWS = new aaAmazonWS($amazon_settings['AccessKeyID'], $amazon_settings['SecretAccessKey'], $amazon_settings['country'], $this->main_aff_id()); $selectedItems = array(); foreach ($asins as $key => $value) { $selectedItems[] = array('offerId' => $value, 'quantity' => 1); } // debug only $aaAmazonWS->cartKill(); $cart = $aaAmazonWS->responseGroup('Cart')->cartThem($selectedItems); $cart_items = isset($cart['CartItems']['CartItem']) ? $cart['CartItems']['CartItem'] : array(); if (count($cart_items) > 0) { header('Location: ' . $cart['PurchaseURL'] . "&tag=" . $amazon_settings['AffiliateId']); exit; } } } } }