Is it possible to mark one item at a time as shipped?

If an entire order can't be shipped at once, is there any way to mark individual items in an order as shipped without marking the entire order?

  • Scott

    That's not exactly what I'm looking for. I am using Events + in conjunction with Marketpress in order to sell tickets. We want a way to 'check-in' users at the door. Since Events + and Marketpress don't offer this out of the box, we are modifying a few things. So far we've added the QR code to the purchase confirmation email, and that links to the back end where users manage each individual order.

    I figure that from back there the person running the door at the event can scan the QR code, get to the back end order management page for that order, and mark the ticket (in this case an individual product in the Marketpress store) as being "shipped" (which we will just use as an indication of the ticket's use). Right now you can mark the entire order as shipped, and I want each individual item to be marked one at a time. That way if a user purchases tickets for multiple shows, their entire ticket order isn't marked as used when they go to the second show.

    Also, we don't want to get rid of the shipping. What we have also done is changed the "shipping" into our fee schedule. We charge a fee on top of the ticket price and have re-purposed the shipping component to have table rate prices of our fees based on the ticket prices.

    What we are trying to do is replace the functionality of Event Espresso with a combination of WPMUDEV plugins.

  • Saurabh

    Hi Cara,

    Shipping and Order status, etc are features of an order, as a whole. The thread that @Dharmendra has mentioned (https://premium.wpmudev.org/forums/topic/marketpress-option-of-no-shipping-per-item) requests a feature to make shipping a feature of individual products of an order, which is exactly what you need.

    However, currently individual items can't be separated out of an order for any order related functionality like shipping. This would require a fundamental rewrite of the shipping process, which is why we'd need a decent amount of backing for this feature. It isn't usually the case in ecommerce setups that such functionality is required.

    So, I request you to visit the thread and add your +1, so our team can evaluate user feedback and include it in our roadmap.

    Best

    Saurabh

  • Saurabh

    Now, what you could do, in your case is pull the order out, using the order_id and store the items from the order, somewhere in the database (say as a new custom post type, that has no ui and can't be viewed on the front-end) with an unused (or, draft) status.

    Once you scan the qr code, you could change the status, to a used (or published) status. Each such use will check if there are any remaining tickets from the said order_id. If all have been used, you could then mark the whole order as shipped.

    There is an mp_order_paid action that is called when payment is completed. Another action, mp_new_order is run when a new order is created. Both provide the order object that you can use to create the check-in functionality for your tickets. So, you'd need custom code that goes something like this:

    <?php
    add_action( 'mp_order_paid', 'my_ticket_checkin_function' );
    
    function my_ticket_checkin_function($order){
    	if (!$order){
    		return false;
    	}
    
    	if (is_array($order->mp_cart_info) && count($order->mp_cart_info)) {
    		foreach ($order->mp_cart_info as $product_id => $variations) {
    			// do something with each item, store $order->ID
    			// you could also loop through each variation
    			foreach ($variations as $variation => $data) {
    			}
    		}
    	}
    
    }
    ?>

    I hope this helps you create a nice checkin system. Do share your results with us.

    Best,

    Saurabh

  • Scott

    I wonder would it be easier to handle it from the Events + side? Marketpress seems to send some info to Events + as in the RSVP toggle the people are marked as paid. Where is this information stored?

    It seems like maybe it could just be easier to append a toggle to each attendee that can be switched on or off for that event. That way we wouldn't have to worry about organizers from different events possibly having access to information for events that they don't manage. I'm not sure if that would be more, or less difficult.

  • Saurabh

    Hi Cara,

    That's a good deduction! However, the mechanism by which marketpress does this is the same as the one I have suggested earlier.

    See plugins/events-and-bookings/lib/plugins/eab-payment-marketpress.php, lines 26-27:

    add_action('order_received_to_order_paid', array($this, 'mp_product_order_paid'));
            add_action('mp_new_order', array($this, 'dispatch_mp_product_if_order_paid'));

    and the functions that hook into these actions, mp_product_order_paid, at about line 358. It just modifies the booking status in the appropriate table. This contains another action incsub_event_booking_yes that will give you the event id and the user id when the user is booked to the event.

    You could hook into this action:

    add_action( 'incsub_event_booking_yes', 'my_custom_checkin_function', 99, 2);
    
    function my_custom_checkin_function( $event_id, $user_id ){
        // store event_id and user_id association somewhere, maybe in usermeta, like this
        update_user_meta('my_checkin_user_meta_checked_'.$event_id, 0);
    
        // create url for qr code and use wp_nonce
    }

    Now using wp_ajax:

    add_action( 'wp_ajax_add_foobar', 'incsub_checkin_user_event' );
    add_action( 'wp_ajax_no_priv_incsub_checkin_user', 'incsub_checkin_user_event' );
    
    function incsub_checkin_user_event(){
        // include nonce checking, before the following
        $user_id = $_GET['user_id'];
        $event_id = $_GET['event_id'];
        update_user_meta('my_checkin_user_meta_checked_'.$event_id, 1);
       die('checked in');
    }

    Your QR code would point to this url, for example:

    http://yoursite.com/wp-admin/admin-ajax.php?user_id=23&event_id=34&nonce=vsr453ags

    The rest is fairly simple to build. A simple function to generate the url, from where you could either build the QR code manually or using one of the numerous libraries, available.

    I hope this helps.

    Best

    Saurabh

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.