} //echo $digital['price_calc']; switch ($digital['credits_calc']) { case 'add': $digital['credits'] = round($mediaCredits + $digital['credits']); break; case 'sub': $digital['credits'] = round($mediaCredits - $digital['credits']); break; case 'mult': $digital['credits'] = round($mediaCredits * $digital['credits']); break; } if ($digital['quantity'] > 0 or $digital['quantity'] == "") { $digitalsArray[$digital['ds_id']] = $digital; $digitalsArray[$digital['ds_id']] = digitalsList($digital, $mediaID); //print_k($digitalsArray); // Testing // If real_sizes is set then calculate the real width and height of this size after it is scaled from the original if ($digital['real_sizes'] && $digital['delivery_method'] != 3) { // Landscape if ($media['width'] >= $media['height']) { @($scaleRatio = $digital['width'] / $media['width']); $width = $digital['width']; $height = round($media['height'] * $scaleRatio); } else { @($scaleRatio = $digital['height'] / $media['height']); $width = round($media['width'] * $scaleRatio); $height = $digital['height']; } } else { if ($digital['delivery_method'] == 3) {
// Check for customized profile /* $customizedDSPResult = mysqli_query($db,"SELECT SQL_CALC_FOUND_ROWS * FROM {$dbinfo[pre]}media_digital_sizes WHERE ds_id = '{$cartItem[item_id]}' AND media_id = '{$cartItem[asset_id]}'"); if(getRows()) $customizedDSP = mysqli_fetch_assoc($customizedDSPResult); */ //print_r($customizedDSP); //echo "rows: {$customizedRows}"; if ($mediaInfo->getRows()) { $media = $mediaInfo->getSingleMediaDetails('thumb'); } $digital = digitalPrep($cartItem['item_id'], $media); $numOfDigitals += $cartItem['quantity']; // Count the number of product items in the cart //$isOriginal = ($cartItem['item_id']) ? true : false; $digitalDetails = digitalsList($digital, $cartItem['asset_id']); //print_r($digitalDetails); exit; //print_r($digitalDetails); exit; $digitalDetails['cartEditLink'] .= '&edit=' . $cartItem['oi_id']; // Add edit var if (!$cartItem['paytype']) { $cartItem['paytype'] = 'cur'; } // Make sure the payType is set just in case $cartItemsArray[$cartItem['oi_id']]['usePayType'] = $cartItem['paytype']; // Set the payType to the item $cartItemsArray[$cartItem['oi_id']]['payTypeCount'] = 0; // Number of options available to pay $numOfDigitalFiles += $cartItem['quantity']; // Count the number of digital items in the cart /*
$digital['credits'] = round($mediaCredits - $digital['credits']); break; case 'mult': $digital['credits'] = round($mediaCredits * $digital['credits']); break; } $digitalSizePixels = $digital['width'] * $digital['height']; $longestDigitalSizeSide = $digital['width'] >= $digital['height'] ? $digital['width'] : $digital['height']; if ($longestDigitalSizeSide <= $media['width'] or $longestDigitalSizeSide <= $media['height']) { $validSize = true; } else { $validSize = false; } // Make sure that this size is big enough to list or if force list is in effect if ($validSize == true or $digital['force_list']) { $digital = digitalsList($digital, $mediaID); // If real_sizes is set then calculate the real width and height of this size after it is scaled from the original if ($digital['real_sizes']) { // Landscape if ($media['width'] >= $media['height']) { @($scaleRatio = $digital['width'] / $media['width']); $width = $digital['width']; $height = round($media['height'] * $scaleRatio); } else { @($scaleRatio = $digital['height'] / $media['height']); $width = round($media['width'] * $scaleRatio); $height = $digital['height']; } } else { $width = $digital['width']; $height = $digital['height'];