• I am using a plugin called Sequential Orders that does three things.

    Started new orders at a given number. (1001xxxx)
    Prefixed orders with a string (W-)
    Keeps all actual orders sequential.

    #1 was important because with we implemented woo in place of a 20 year old store and single digit order numbers have duplicates in our database. in the admin console, everything is working exactly as expected.

    In Shipworks, however, all the orders are still the underlying Woo orders (post Id?) and colliding with very old orders.

    Is there anyway to get SWC to use the order number field instead of the record number?

    • This topic was modified 3 years, 4 months ago by pldoolittle.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter pldoolittle

    (@pldoolittle)

    For reference, this plugin stores the order id in the table ns_postmeta with a meta_key set to a value of ‘_order_number’ and meta_value set to the order ID.

    When this plug in is installed, everything inside woocommerce refers to the order by the meta value.

    From the code, this may help:

    // Show sequential order number
    add_filter('woocommerce_order_number', array($this, 'display_sequence_number'), 10, 2);
    public function display_sequence_number($order_number, $order) {
            $order_id = (WC()->version < '2.7.0') ? $order->id : $order->get_id();
            $sequential_order_number = get_post_meta($order_id, '_order_number', TRUE);
            $sequential_order_number = apply_filters('wt_alter_sequence_number',$sequential_order_number,$order_id);
            return ($sequential_order_number) ? $sequential_order_number : $order_number;
        }

    If I understand this correctly, woocommerce_order_number is being overridden. Which suggests that the ShipWorks Connector for Woocommerce is getting it’s data directly from the DB? or via another WC function that is not being overridden.

    Is there a fix/workaround?

    • This reply was modified 3 years, 4 months ago by pldoolittle.
    • This reply was modified 3 years, 4 months ago by pldoolittle.
    • This reply was modified 3 years, 4 months ago by pldoolittle.
    • This reply was modified 3 years, 4 months ago by pldoolittle.
    Thread Starter pldoolittle

    (@pldoolittle)

    Armed with that info, I dug into your plug in and found this:

    shipworks-e-commerce-bridge\model\Order.class.php

    if ( ( is_plugin_active_custom( "woocommerce-sequential-order-numbers/woocommerce-sequential-order-numbers.php")
    				||  is_plugin_active_custom( "woocommerce-sequential-order-numbers-pro/woocommerce-sequential-order-numbers.php")
    					||  is_plugin_active_custom( "woocommerce-sequential-order-numbers-pro/woocommerce-sequential-order-numbers-pro.php") ) ) {
    ...
    				if(getInformation( $this->row, '_order_number' ) != NULL) {
    					$this->id_order = getInformation( $this->row, '_order_number' );

    BUT…. The module I have(webToffee – Sequential Order Numbers for WooCommerce), does not live in:

    woocommerce-sequential-order-numbers/woocommerce-sequential-order-numbers.php

    It lives at wt-woocommerce-sequential-order-numbers/wt-advanced-order-number.php

    So I made the following modification and it works! Well, it appears to, hopefully nothing else was broken with this hack.

    	if ( ( is_plugin_active_custom( "woocommerce-sequential-order-numbers/woocommerce-sequential-order-numbers.php")
    				||  is_plugin_active_custom( "woocommerce-sequential-order-numbers-pro/woocommerce-sequential-order-numbers.php")
    					||  is_plugin_active_custom( "wt-woocommerce-sequential-order-numbers/wt-advanced-order-number.php")
    						||  is_plugin_active_custom("woocommerce-sequential-order-numbers-pro/woocommerce-sequential-order-numbers-pro.php") ) ) {
    • This reply was modified 3 years, 4 months ago by pldoolittle.
    Thread Starter pldoolittle

    (@pldoolittle)

    Well, we have a small snag. The order failed to upload with the error:

    An Error occurred uploading shipment information for order -9223372036854775808
    Note: that is NOT the tracking number.

    So I dropped the W prefix from the order number and got this error:

    An Error occurred uploading shipment information for order 1011132
    Note: that is the correct sequential order number.

    • This reply was modified 3 years, 4 months ago by pldoolittle.
    Thread Starter pldoolittle

    (@pldoolittle)

    This was the request:

    <Post>
    <Url>https://domainname.com/store/wp-admin/admin.php?page=shipworks-wordpress</Url><Parameter><Name>order</Name><Value>1011132</Value></Parameter>
    <Parameter><Name>tracking</Name><Value>XXXXXXXXXXXXXXX</Value></Parameter>
    <Parameter><Name>carrier</Name><Value>USPS</Value></Parameter>
    <Parameter><Name>shippingcost</Name><Value>3.3100</Value></Parameter>
    <Parameter><Name>shippingdate</Name><Value>2021-11-04T04:00:00</Value></Parameter>
    <Parameter><Name>action</Name><Value>updateshipment</Value></Parameter>
    <Parameter><Name>username</Name><Value>XXXXXXXXXXX</Value></Parameter>
    <Parameter><Name>password</Name><Value>XXXXXXXXXXXXXXX</Value></Parameter>
    </Post>

    And the response:

    <?xml version="1.0" standalone="yes" ?><ShipWorks moduleVersion="3.1.22.3273" schemaVersion="1.0.0">
      <Error>
        <Code>ERR004</Code>
        <Description>The order is not in the Database</Description>
      </Error>
    </ShipWorks>
    • This reply was modified 3 years, 4 months ago by pldoolittle.
    • This reply was modified 3 years, 4 months ago by pldoolittle.
    • This reply was modified 3 years, 4 months ago by pldoolittle.
    Thread Starter pldoolittle

    (@pldoolittle)

    Looking into Shipworks further, simply placing the _order_number into a custom field would solve the update problem and allow searching by the alternate order number.

    It’s not ideal, as it would require that all templates using order number be modified to detect the presence of an alternate order number, but it would make the values available and place further coding in the hands of the users (i.e. me).

    Thread Starter pldoolittle

    (@pldoolittle)

    Ok, with the help of the plugin vendor, I have it mostly working. The following line

    || is_plugin_active_custom( "wt-woocommerce-sequential-order-numbers/wt-advanced-order-number.php"))

    Needs to be inserted after:

    if ( is_plugin_active_custom( "woocommerce-sequential-order-numbers/woocommerce-sequential-order-numbers.php")

    In these files:
    /shipworks-e-commerce-bridge/model/Order.class.php
    /shipworks-e-commerce-bridge/model/StatusManager.class.php
    /shipworks-e-commerce-bridge/model/TrackingManager.class.php

    At this point, it works EXCEPT:
    – If you use an alpha prefix (appears to be a typing issue)
    – Changing an order from “On Hold” to “Processing” is not picked up in Shipworks.

    BUT…
    Updating orders to Completed in Shipworks now fires the Woo Completed action.

    • This reply was modified 3 years, 4 months ago by pldoolittle.
    Plugin Author AdvancedCreation

    (@advancedcreation)

    Hello,

    Sorry I just saw your message, I believe you are not using the plugin compatible with our plugin, sequential order number plugin should be the one made by Skyverge.
    Please contact us directly via the contact form or via the chat online on our website, I will reply right away.
    Thank you
    Olivier

    Thread Starter pldoolittle

    (@pldoolittle)

    Olivier,

    I am absolutely using your plugin. And I am using the only authorized shipworks plugin.

    I detailed the problem and did the troubleshooting for you. Please fix.

    Thread Starter pldoolittle

    (@pldoolittle)

    The latest update broke my store functionality again. It is a simple fix to your code, please include it in future releases.

    In these files:

    • Order.class.php
    • StatusManager.class.php
    • TrackingManager.class.php

    Find this:

    if ( ( is_plugin_active_custom( "woocommerce-sequential-order-numbers/woocommerce-sequential-order-numbers.php")
    	||  is_plugin_active_custom( "woocommerce-sequential-order-numbers-pro/woocommerce-sequential-order-numbers.php")
    	||  is_plugin_active_custom( "woocommerce-sequential-order-numbers-pro/woocommerce-sequential-order-numbers-pro.php") ) ) {

    And replace it with this:

    if ( is_plugin_active_custom( "woocommerce-sequential-order-numbers/woocommerce-sequential-order-numbers.php")
    	||  is_plugin_active_custom( "woocommerce-sequential-order-numbers-pro/woocommerce-sequential-order-numbers.php")
    	||  is_plugin_active_custom( "woocommerce-sequential-order-numbers-pro/woocommerce-sequential-order-numbers-pro.php")
    	||  is_plugin_active_custom( "wt-woocommerce-sequential-order-numbers/wt-advanced-order-number.php")) {
    Plugin Author AdvancedCreation

    (@advancedcreation)

    sorry but webtoffee sequential order number is not yet compatible, only this plugin is compatible with the pro version
    https://www.ads-software.com/plugins/woocommerce-sequential-order-numbers/

    If you already did the work, please contact me via our form on our website https://adv.design, and I will add it to the next update

    Let me know
    Olivier

    Thread Starter pldoolittle

    (@pldoolittle)

    Olivier,

    yes, I already made the changes. They are listed in the post you just replied to.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Sequential orders pro’ is closed to new replies.