function product_imager_set_images() { check_ajax_referer('product_imager_nonce', 'security'); $product_id = isset($_POST['product_id']) ? intval($_POST['product_id']) : 0; $image_urls = isset($_POST['image_urls']) ? (array) $_POST['image_urls'] : []; if (empty($product_id)) { wp_send_json_error(['message' => __('Error: Product ID is missing.', 'product-imager')]); } if (empty($image_urls)) { wp_send_json_error(['message' => __('Error: No images were selected.', 'product-imager')]); } // Example logic for testing download without changing existing functionality $upload_dir = wp_upload_dir(); $product_images_dir = $upload_dir['basedir'] . '/productimages'; if (!file_exists($product_images_dir)) { if (!wp_mkdir_p($product_images_dir)) { wp_send_json_error(['message' => __('Error: Failed to create directory for images.', 'product-imager')]); } } $successful_downloads = []; foreach ($image_urls as $image_url) { if (!filter_var($image_url, FILTER_VALIDATE_URL)) { continue; } $image_data = wp_remote_get($image_url); if (is_wp_error($image_data)) { continue; } $image_body = wp_remote_retrieve_body($image_data); $image_name = sanitize_file_name(basename(parse_url($image_url, PHP_URL_PATH))); $file_path = $product_images_dir . '/' . $image_name; if (file_put_contents($file_path, $image_body) !== false) { $successful_downloads[] = $file_path; } } if (empty($successful_downloads)) { wp_send_json_error(['message' => __('Error: No images were downloaded successfully.', 'product-imager')]); } wp_send_json_success(['message' => __('Images downloaded successfully!', 'product-imager')]); } Naan Original 48/4.4-oz/Case – Horizon Foods – Wholesale Food Distributor
et-loader

Needing Assistance? Call Us: 443-402-1728

Naan Original 48/4.4-oz/Case

SKU:

$56.60

Available: 1
🔥 6 items sold in last 3 months
11 people are viewing this product in the last 3 months.
or
Secured Checkout: Pay safely with Visa Pay safely with Master Card Pay safely with PayPal Pay safely with American Express Pay safely with Maestro Pay safely with Bitcoin
Cash Discount on Pickup Eligible

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Placeholder Naan Original 48/4.4-oz/Case

$56.60

1 in stock

Recent Products

Cash Discounting Available
Secure Payments
100% Satisfaction Guarantee!
Top-Notch Shopping

Recent Products

Account Menu
Account Menu
Address

704 Pulaski Hwy, Joppatowne, MD 21085

Information

Hotline: 443-402-1728
jennifer@horizonfoodstore.com

Follow Us

Cart