The current shipping code is incompatible with commerce_shipping -dev (future RC1), because upstream changed the format of the ShippingRate object. In general, having to extend the plugin opens us up to incompatibilities. However, there is no longer a need to do that. Beta8 and -dev have a SHIPPING_RATES event which the module can subscribe to in order to modify the amount and perform the currency conversion.

Notes:
- Give the subscriber a high priority so that it runs before the promotion one in shipping
- Convert both the amount and the initial amount.

Comments

bojanz created an issue. See original summary.

valic’s picture

Assigned: Unassigned » valic

Excellent!

Probably going also to separate the shipping part now as a submodule.

valic’s picture

valic’s picture

Status: Active » Needs review

Moved shipping to a submodule: commerce_currency_resolver_shipping, so it is more isolated from the module itself.

Event for rates added, but still, we need to extend shipment rates because of the ability to enter prices in currencies on each shipment method. (but it is just extending of configuration form, haven't found a better way for inserting fields)

But also updated readme, with two ways of integrating with shipping. And one way does not require a resolver shipping submodule at all.

1. If you are using condition Order currency and the selected currency matches the price currency selected under Rate amount then you don't need to do anything.

2. If you need to auto-calculate price or have multiple prices per shipping method you need to enable submodule commerce_currency_resolver_shipping.

valic’s picture

Assigned: valic » Unassigned
StatusFileSize
new30.09 KB
new11.04 KB

Shipping RC1 is out https://www.drupal.org/project/commerce_shipping/releases/8.x-2.0-rc1

Increased version of commerce_shipping as required. Added basic test coverage for shipping integration

Status: Needs review » Needs work

The last submitted patch, 5: rework_the_shipping_integration_3111998-5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

valic’s picture

Status: Needs work » Needs review
StatusFileSize
new30.09 KB
new674 bytes

we cant use commerce_shipping_test without commerce_shipping in test :-D

Status: Needs review » Needs work

The last submitted patch, 7: rework_the_shipping_integration_3111998-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

valic’s picture

Status: Needs work » Needs review
StatusFileSize
new30.15 KB
new261 bytes

added test dependency on shipping in the main module

Status: Needs review » Needs work

The last submitted patch, 9: rework_the_shipping_integration_3111998-9.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

valic’s picture

Status: Needs work » Needs review
StatusFileSize
new29.83 KB
new2.88 KB

Status: Needs review » Needs work

The last submitted patch, 11: rework_the_shipping_integration_3111998-11.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

valic’s picture

Status: Needs work » Needs review
StatusFileSize
new30.91 KB
new2.05 KB

  • valic committed d87c19b on 8.x-1.x
    Issue #3111998 by valic, bojanz: Rework the shipping integration
    
valic’s picture

Status: Needs review » Fixed

time for sleep!

valic’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.