Skip to content

Instantly share code, notes, and snippets.

@Dayjo
Last active January 8, 2020 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dayjo/f830bb01b078a3ad1c68b5861aaf716d to your computer and use it in GitHub Desktop.
Save Dayjo/f830bb01b078a3ad1c68b5861aaf716d to your computer and use it in GitHub Desktop.
Order Status change

If bulk selecting, you should always see some sort of confirm dialog. On single orders you may not (depending on your email/config settings).

  • If shop config set to 'confirm before sending', confirm the change in a dialog with a 'send email' checkbox and email text box for editing the email content

  • If changing an individual order status and config set to 'send automatically' or 'never send emails', don't show confirm dialog.

  • If bulk selection and 'send automatically', show confirm dialog with 'send email' checkbox automatically checked

  • If bulk selection and 'never send', show confirmation but don't ask about emails

  • If you have selected orders that are already the status that you're changing to, output a message and checkbox saying "X of these orders are already set to they may have already received these emails. Do you still want to send emails to these customers?"

  • The email content in text editor is processed with order data if individual order (displayed with real order info). If bulk orders selected, it will display the email with the placeholders.

Before Tasking out

  • Describe ajax order further info functionality and logic
  • Note down any Hookpoint / Bolton Functionality to ensure it is replicated
  • Feedback from Others on the flow?
    • Adam
    • Rebecca

Abitrary Task List

  • Refactor / remove old js
  • Remove refund from bulk actions
  • Load in shop config settings into the frontend for logic
  • New ajax endpoint for bulk actionss
  • Events for;
    • OrderUpdateStatus
    • Emails
    • Ebay
    • [ ]
  • Don't show confirm if changing between same top level status i.e. processing to processing - packaging

Email Editor

  • Process email contents template with order data for editing
  • Process template vars on email contents
  • Endpoint for getting email contents

OrderUpdateStatus Event

  • Update the status and substatus of the order based on the request
  • if changing the status FROM cancelled to something else, remove the order qty stock from the products table
  • if changing to cancelled and restock flag is set then restock the products
  • BACKEND_SHOP_ORDER_STATUS_UPDATE
    • ebay order_status_update
    • product rating queue_voting_email
  • Send email automatically if shop config says to or manually if event request says to
  • orderLog the action

Modal

  • Confirmation Message with Logic for number of orders and dispatched
  • Send Email Checkbox (if needed)
  • Email Content Textarea (if needed)
  • X of these orders are already set to STATUS. They may have already received these emails. Do you still want to send emails to these customers? Yes, Send to All? CHECKBOX (if 'send email' checked and needed)
  • Update / Cancel buttons

Mark Orders as <STATUS>

Are you sure you want to mark <n|this> order<s> as <STATUS>?


  • Send Email?

[EDITABLE EMAIL TEXT]

<X> of these are already <STATUS>

  • Resend email to these orders

mini_info - Deprecated

Outputs info on an order to old order management

getDispatchMessage - Deprecated (will be merged into generic get email text)

if shop config send_dispatch Returns the shop config dispatch_email

getEmailText

Gets the email text for the specified type and returns it if shop config send_type us set

  1. processing
  2. dispatch
  3. refund

updatestatus

Changes the status of orders and fires off any appropriate events (emails, stock changes etc)

  • Determine the status and substatus wanted to change to based on the request
  • Fire an OrderChangeStatus event
  • if changing the status FROM cancelled to something else, remove the order qty stock from the products table
  • BACKEND_SHOP_ORDER_STATUS_UPDATE
    • ebay order_status_update
    • product rating queue_voting_email
  • Send email manually or automatically based on shop config
  • orderLog the action

cancelandrestock

  • Loops through products in the order and re-adds the qty to the product stock levels

listorders - Deprecated

  • BACKEND_SHOP_ORDERMANAGEMENT_STARTLIST
  • lists the orders for legacy order management

updateLayout - Deprecated

  • Updates management_grid_layout

bolton

  • 'AJAX_ORDER_BOLTON_' . $_REQUEST['bolton_action']
  • refund_transaction

deleteOrder - Deprecated

Returns the content of the delete order confirmation modal

deleteOrderConfirm

Actually deletes the order (just nulls all personal identifyable info) (could be the cause of blank orders turning up)

deleteOrderSuccess - Deprecated

Success response message

deleteOrderFailed - Deprecated

Failure response message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment