Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit d029eb4

Browse files
authored
Merge pull request #2980 from wordpress-mobile/task/add-new-woo-shipping-plugin
Add new shipping plugin.
2 parents 97a7bd8 + 0b7a495 commit d029eb4

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

example/src/main/java/org/wordpress/android/fluxc/example/ui/shippinglabels/WooShippingLabelFragment.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import org.wordpress.android.fluxc.store.WCOrderStore.FetchOrdersByIdsPayload
4747
import org.wordpress.android.fluxc.store.WCShippingLabelStore
4848
import org.wordpress.android.fluxc.store.WooCommerceStore
4949
import org.wordpress.android.fluxc.store.WooCommerceStore.WooPlugin.WOO_SERVICES
50+
import org.wordpress.android.fluxc.store.WooCommerceStore.WooPlugin.WOO_SHIPPING
5051
import java.io.File
5152
import java.io.FileOutputStream
5253
import java.io.IOException
@@ -656,8 +657,15 @@ class WooShippingLabelFragment : StoreSelectingFragment() {
656657
result.error?.let {
657658
prependToLog("${it.type}: ${it.message}")
658659
}
659-
val plugin = wooCommerceStore.getSitePlugin(site, WOO_SERVICES)
660-
plugin?.let {
660+
661+
// Legacy Shipping Plugin
662+
val servicesPlugin = wooCommerceStore.getSitePlugin(site, WOO_SERVICES)
663+
servicesPlugin?.let {
664+
prependToLog("${it.displayName} ${it.version}")
665+
}
666+
667+
val shippingPlugin = wooCommerceStore.getSitePlugin(site, WOO_SHIPPING)
668+
shippingPlugin?.let {
661669
prependToLog("${it.displayName} ${it.version}")
662670
}
663671
}

plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/store/WooCommerceStore.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ open class WooCommerceStore @Inject constructor(
6363
enum class WooPlugin(val pluginName: String) {
6464
WOO_CORE("woocommerce/woocommerce"),
6565
WOO_SERVICES("woocommerce-services/woocommerce-services"),
66+
WOO_SHIPPING("woocommerce-shipping/woocommerce-shipping"),
6667
WOO_PAYMENTS("woocommerce-payments/woocommerce-payments"),
6768
WOO_STRIPE_GATEWAY("woocommerce-gateway-stripe/woocommerce-gateway-stripe"),
6869
WOO_SHIPMENT_TRACKING("woocommerce-shipment-tracking/woocommerce-shipment-tracking"),

0 commit comments

Comments
 (0)