• Resolved sprucelydesigned

    (@sprucelydesigned)


    We encountered an interesting bug when using the admin Pay for order button to take a phone order today (our first after switching to this plugin from the “official” one).

    The shop manager clicked add order and edited the detail of the order, but didn’t click Create to create the order before clicking Pay for order and taking payment. The plugin successfully took the payment, but created the order with the post ID as the order number (default Woo) instead of the sequential order number.

    So in this situation, the order simply disappeared from the order lists completely. I went to Stripe and found the order number listed on the payment detail, then manually went to /wp-admin/admin.php?page=wc-orders&action=edit&id=12549
    This showed the order still in Pending Payment status with a “Create” button available to save the post (instead of the usual “Update” if an order already exists). Once I clicked create and manually changed the status to Processing, the order properly appeared in the Orders list.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @sprucelydesigned

    When using the Pay for Order functionality, we recommend the order be fully created first. That ensures any 3rd party integrations like your sequential order number plugin can provide values etc.

    We could take a look at disabling the pay button until the order is fully created.

    Kind Regards

    Thread Starter sprucelydesigned

    (@sprucelydesigned)

    I think that’s an excellent solution! My preference would be for the button to be visible but disabled and the tool-tip to explain to create the order first to enable the Pay for order button.

    • This reply was modified 8 months, 4 weeks ago by sprucelydesigned. Reason: Removed proposed solution that didn't properly work
    Thread Starter sprucelydesigned

    (@sprucelydesigned)

    I’ve temporarily patched my copy of your plugin with the following fix to address this (updated after my previous post).

    In the file /wp-content/plugins/woo-stripe-payment/includes/admin/meta-boxes/views/html-order-pay.php
    I updated the <p> html at the top of the file to this:

    <p class="form-field form-field-wide">
    	<?php
    		$order_post_status = get_post_status( $order->get_id() );
    		$disabled_attr     = '';
    		$tooltip           = __( 'Admins can process customer orders over the phone using this functionality.', 'woo-stripe-payment' );
    
    	if ( 'auto-draft' === $order_post_status ) {
    		$disabled_attr = 'disabled="disabled"';
    		$tooltip       = __( 'Please create the order before processing payment.', 'woo-stripe-payment' );
    	}
    	?>
    	<button class="button button-secondary wc-stripe-pay-order" <?php echo $disabled_attr; ?>>
    		<?php esc_html_e( 'Pay for Order', 'woo-stripe-payment' ); ?>
    	</button>
    	<?php echo wc_help_tip( $tooltip ); ?>
    </p>

    That effectively accomplishes what I think is the best solution of disabling the button and providing a tool tip text to explain why:

    Maybe you all can add this bug-fix/feature in a future release?

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @sprucelydesigned

    Thank you for providing your solution to this request. I’ll make sure this gets added to the next release of the plugin.

    Kind Regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Conflict with Sequential Order Numbers and Admin Phone Order feature’ is closed to new replies.