Skip to content

[Shipping labels] Default label paper size setting not being used when printing shipping labels #13958

Open
@rachelmcr

Description

@rachelmcr

Describe the bug

After purchasing a shipping label, the app always defaults to the legal paper size, even if the user has set a different default paper size in the Shipping settings in wp-admin.

This happens because we only check for the default paper size setting on the shipping label settings, but a new label doesn't have any default settings. For a newly purchased label, we should be checking the account settings for the default.

Related discussion: p1726218332825849-slack-C05VBLKHHV1

To Reproduce
Steps to reproduce the behavior:

  1. Ensure the WooCommerce Shipping & Tax or WooCommerce Shipping extension is installed and set up on your store.
  2. Create an order with the processing status and at least one physical product.
  3. In the order details, tap the "Create Shipping Label" button.
  4. Complete the shipping label flow and purchase the label.
  5. After the purchase is complete, on the "Print Shipping Label" screen, notice that the default paper size is Legal.

Screenshots

In the app, after purchasing a label:

In wp-admin:

Screenshot 2024-09-13 at 12 06 42

Expected behavior

After purchasing a shipping label, the app should default to the default paper size in the shipping account settings (ShippingLabelAccountSettings.paperSize).

For existing shipping labels, I believe the priority should be:

  1. Default paper size setting for the shipping label (ShippingLabelSettings.paperSize)
  2. If there isn't a default for the shipping label, fall back to the account settings (ShippingLabelAccountSettings.paperSize)
  3. If there isn't a default in the account settings, fall back to a default option

However, I'd suggest we default to label or letter size in the last case, rather than legal (which seems like an odd default).

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature: shipping labelsRelated to creating, ordering, or printing shipping labels.type: bugA confirmed bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions