ResolvedCloud order printing

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #26163
    admin-7592
    Participant

    Hi,

    I’m using Star Cloud-print to print the orders. All works, but is not printing the variations of Lafka global addon.

    Here is the code of cloud print

    function star_cloudprnt_create_receipt_items($order, &$printer, $max_chars)
    {
    $order_items = $order->get_items();
    foreach ($order_items as $item_id => $item_data)
    {
    $product_name = $item_data[‘name’];
    $product_id = $item_data[‘product_id’];
    $variation_id = $item_data[‘variation_id’];

    $item_qty = $order->get_item_meta($item_id, “_qty”, true);
    $item_total_price = floatval($order->get_item_meta($item_id, “_line_total”, true))
    +floatval($order->get_item_meta($item_id, “_line_tax”, true));
    $item_price = floatval($item_total_price) / intval($item_qty);
    $currencyHex = star_cloudprnt_get_codepage_currency_symbol();
    $formatted_item_price = number_format($item_price, 2, ‘.’, ”);
    $formatted_total_price = number_format($item_total_price, 2, ‘.’, ”);

    $printer->set_text_emphasized();
    $printer->add_text_line(str_replace(‘–’, ‘-‘, $product_name).” – ID: “.$product_id.””);
    $printer->cancel_text_emphasized();

    if ($variation_id != 0)
    {
    $product_variation = new WC_Product_Variation( $variation_id );
    $variation_data = $product_variation->get_variation_attributes();
    $variation_detail = star_cloudprnt_get_formatted_variation($variation_data, $order, $item_id);
    $exploded = explode(“||”, $variation_detail);
    foreach($exploded as $exploded_variation)
    {
    $printer->add_text_line(” “.ucwords($exploded_variation));
    }
    }
    $printer->add_text_line(star_cloudprnt_get_column_separated_data(array(” Qty: “.
    $item_qty.” x Cost: “.$currencyHex.$formatted_item_price,
    $currencyHex.$formatted_total_price), $max_chars));
    }
    }

    How I can add the customs variations?

    Thanks

    #26167
    zeli.armel
    Participant

    Hi,

    I’m using also the Star CloudPRNT for WooCommerce plugin, see the solution here : https://wordpress.org/support/topic/add-on-and-custom-field/ (this is my own topic)

    Kind regards

    #26179
    Althemist
    Keymaster

    Hi zeli.armel,

    Thanks for sharing such valuable information with other fellow users. 🙂

    Best regards,
    Dimitar

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register