Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Update the product types to use IDs (#2841)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuatf authored Aug 27, 2019
1 parent 7ec2cd4 commit e9ce3f9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Features/Onboarding.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,19 @@ public static function get_allowed_product_types() {
),
'subscriptions' => array(
'label' => __( 'Subscriptions', 'woocommerce-admin' ),
'product' => 'woocommerce-subscriptions',
'product' => 27147,
),
'memberships' => array(
'label' => __( 'Memberships', 'woocommerce-admin' ),
'product' => 'woocommerce-memberships',
'product' => 958589,
),
'composite' => array(
'label' => __( 'Composite Products', 'woocommerce-admin' ),
'product' => 'woocommerce-composite-products',
'product' => 216836,
),
'bookings' => array(
'label' => __( 'Bookings', 'woocommerce-admin' ),
'product' => 'WooCommerce Bookings',
'product' => 390890,
),
)
);
Expand Down Expand Up @@ -267,9 +267,9 @@ public static function append_product_data( $product_types ) {
$product_data = json_decode( $woocommerce_products['body'] );
$products = array();

// Map product data by slug.
// Map product data by ID.
foreach ( $product_data->products as $product_datum ) {
$products[ $product_datum->slug ] = $product_datum;
$products[ $product_datum->id ] = $product_datum;
}

// Loop over product types and append data.
Expand Down

0 comments on commit e9ce3f9

Please sign in to comment.