Search code examples
magentomagento-soap-api

Magento Sales > Order > Shipment History > Visible on frontend by default


shipment

Customers are having trouble seeing the tracking information of an order they placed. I figure maybe it has something to do with making "visible on frontend" default. How would I go about doing this? I'm thinking its similar to this solution: Magento - Email Shipment = Default but if not I can put it into the SOAP calls that are made to import the order tracking numbers.

Part of the script that imports the order tracking information into the system:

// Attempt to create the order, notify on failure
            try { $newShipmentId = $client->call($sess_id, 'sales_order_shipment.create', array($ShippedOrderId, array(), $comment, true, false, $shippedby, $shipname, $fields[4])); }
            catch (Exception $e) { echo 'Shipment creation failed on order '. $ShippedOrderId . ': ', $e->getMessage(); }
            // Add comment to order with all the info
            $client->call($sess_id, 'sales_order.addComment', array($ShippedOrderId, 'complete',  $comment,  false));
            $client->call($sess_id, 'sales_order_shipment.addTrack', array($ShippedOrderId, $shippedby, $shipname, $fields[4]));
            $mail_content .= $line . "\n";
            $importcount++;

Solution

  • You are looking for this file:

    app/design/adminhtml/default/default/template/sales/order/comments/view.phtml
    

    Just replace

    <input name="comment[is_visible_on_front]" type="checkbox" id="history_visible" value="1" />
    

    with

    <input name="comment[is_visible_on_front]" type="checkbox" id="history_visible" value="1" checked />
    

    to have it checked by default.

    FYI, I have just added "checked" to the input tag.