Announcement

Collapse
No announcement yet.

How to create a "Partially Cancelled" order status?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to create a "Partially Cancelled" order status?

    Hi folks,

    One of my clients has a store that's hooked up to a back-end system which includes a "Partially Cancelled" status for orders. They use this in situations such as a customer cancelling an order for a back-ordered product. MM doesn't explicitly support this status; but after looking at the DB manual, I think there may be something equivalent.

    I see that there's a "status" field in the OrderItems table, but the manual doesn't tell what values are defined. Are they the same as for the Orders table? If we can set a "Cancelled" status for individual OrderItems, that might be sufficient for the client's purposes.

    Are we allowed to create our own status values and store them in any of these tables (Orders, OrderItems, and/or OrderShipments)?

    Any other ideas, such as doing something creative with OrderShipments, OrderReturns, etc.?

    Thanks --
    Last edited by Kent Multer; 06-30-16, 10:37 PM.
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    #2
    From Dev:

    "No, he is not allowed or encouraged to invent his own status codes."
    Thanks,

    Rick Wilson
    CEO
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      OK, thanks for the quick reply. What about my other question, please: can we get a list of the allowed values for OrderItems.d.status, and what they mean? Or are they the same as for the Orders table?

      Thanks --
      Kent Multer
      Magic Metal Productions
      http://TheMagicM.com
      * Web developer/designer
      * E-commerce and Miva
      * Author, The Official Miva Web Scripting Book -- available on-line:
      http://www.amazon.com/exec/obidos/IS...icmetalproducA

      Comment


        #4
        From Dev:

        if ( order.status == 100 ) return 'Processing';
        else if ( order.status == 200 ) return 'Shipped';
        else if ( order.status == 201 ) return 'Partially Shipped';
        else if ( order.status == 300 ) return 'Cancelled';
        else if ( order.status == 400 ) return 'Backordered';
        else if ( order.status == 500 ) return 'RMA Issued';
        else if ( order.status == 600 ) return 'Returned';
        Thanks,

        Rick Wilson
        CEO
        Miva, Inc.
        [email protected]
        https://www.miva.com

        Comment


          #5
          Thanks, but I couldn't help noticing that the above snippet is for a variable called order.status, not orderitem.status. That code is apparently from a function named Order_Status in the file ui.js, which also contains this function:
          Code:
          function OrderItem_Status( orderitem )
          {
              if ( orderitem.status == 100 )
              {
                  if ( orderitem.shipment == null ||
                       orderitem.shipment.code.length == 0 )        return 'Picking';
                  else                                            return 'Picking: ' + encodeentities( orderitem.shipment.code );
              }
              else if ( orderitem.status == 200 )
              {
                  if ( orderitem.shipment == null ||
                       orderitem.shipment.tracknum.length == 0 )    return 'Shipped';
                  else                                            return 'Shipped: ' + encodeentities( orderitem.shipment.tracknum );
              }
              else if ( orderitem.status == 210 )                    return 'Gift Certificate: Not Redeemed';
              else if ( orderitem.status == 211 )                    return 'Gift Certificate: Redeemed';
              else if ( orderitem.status == 220 )                    return 'Digital: Not Downloaded';
              else if ( orderitem.status == 221 )                    return 'Digital: Downloaded';
              else if ( orderitem.status == 300 )                    return 'Cancelled';
              else if ( orderitem.status == 400 )
              {
                  if ( orderitem.dt_instock == '' )                return 'Backordered';
                  else                                            return 'Backordered: ' + Date_Format( orderitem.dt_instock );
              }
              else if ( orderitem.status == 500 )
              {
                  if ( orderitem.rma_code == '' )                    return 'RMA Issued';
                  else                                            return 'RMA Issued: ' + encodeentities( orderitem.rma_code );
              }
              else if ( orderitem.status == 600 )
              {
                  if ( orderitem.rma_dt_recvd == '' )                return 'Returned';
                  else                                            return 'Returned: ' + Date_Format( orderitem.rma_dt_recvd );
              }
          
              return 'Pending';
          }
          This looks like a more complete answer to my question. OrderItems don't have the "Partially Shipped" status, but they do have a few statuses ("stati?") that Orders don't.

          Thanks --
          Kent Multer
          Magic Metal Productions
          http://TheMagicM.com
          * Web developer/designer
          * E-commerce and Miva
          * Author, The Official Miva Web Scripting Book -- available on-line:
          http://www.amazon.com/exec/obidos/IS...icmetalproducA

          Comment

          Working...
          X