HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/mangomitra/public_html/wp-content/plugins/woo-razorpay/includes/api/cart.php
<?php
/**
 * For cart related functionality
 */

/**
 * Create the cart object for the line items exist in order
 */
function create1ccCart($orderId)
{
    global $woocommerce;

    $order = wc_get_order($orderId);

    if ($order && $order->get_item_count() > 0) {
        foreach ($order->get_items() as $item_id => $item) {
            $productId             = $item->get_product_id();
            $variationId           = $item->get_variation_id();
            $quantity              = $item->get_quantity();
            $customData["item_id"] = $item_id;

            WC()->cart->add_to_cart(
                $productId,
                $quantity,
                $variationId,
                [],
                $customData
            );
        }

        return true;
    } else {
        return false;
    }
}