Skip to content

Commit

Permalink
My Jetpack: expose pricing product data (#22630)
Browse files Browse the repository at this point in the history
* [not verified] my-jetpack: add product harcoded data

* [not verified] changelog

* [not verified] my-jetpack: rename product file to pricing_for_ui

* [not verified] my-jetpack: update products pricing for the UI

* my-jepack: fix PHP test
  • Loading branch information
retrofox authored Feb 3, 2022
1 parent 006bb98 commit 4752c6c
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

Add Product princign harcoded data
14 changes: 14 additions & 0 deletions projects/packages/my-jetpack/src/products/class-anti-spam.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,18 @@ public static function get_long_description() {
public static function get_features() {
return array();
}

/**
* Get the product princing details
*
* @return array Pricing details
*/
public static function get_pricing_for_ui() {
return array(
'available' => true,
'currency_code' => 'EUR',
'full_price' => '9',
'promotion_percentage' => '50',
);
}
}
14 changes: 14 additions & 0 deletions projects/packages/my-jetpack/src/products/class-backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,18 @@ public static function get_features() {
);
}

/**
* Get the product princing details
*
* @return array Pricing details
*/
public static function get_pricing_for_ui() {
return array(
'available' => true,
'currency_code' => 'EUR',
'full_price' => '9',
'promotion_percentage' => '50',
);
}

}
12 changes: 12 additions & 0 deletions projects/packages/my-jetpack/src/products/class-boost.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,16 @@ public static function get_long_description() {
public static function get_features() {
return array();
}

/**
* Get the product princing details
*
* @return array Pricing details
*/
public static function get_pricing_for_ui() {
return array(
'available' => true,
'is_free' => true,
);
}
}
12 changes: 12 additions & 0 deletions projects/packages/my-jetpack/src/products/class-crm.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,16 @@ public static function get_long_description() {
public static function get_features() {
return array();
}

/**
* Get the product princing details
*
* @return array Pricing details
*/
public static function get_pricing_for_ui() {
return array(
'available' => true,
'is_free' => true,
);
}
}
8 changes: 8 additions & 0 deletions projects/packages/my-jetpack/src/products/class-product.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public static function get_info() {
'long_description' => static::get_long_description(),
'features' => static::get_features(),
'status' => static::get_status(),
'pricing_for_ui' => static::get_pricing_for_ui(),
'requires_user_connection' => static::$requires_user_connection,
'class' => get_called_class(),
);
Expand Down Expand Up @@ -125,6 +126,13 @@ abstract public static function get_long_description();
*/
abstract public static function get_features();

/**
* Get the product pricing
*
* @return array
*/
abstract public static function get_pricing_for_ui();

/**
* Undocumented function
*
Expand Down
12 changes: 12 additions & 0 deletions projects/packages/my-jetpack/src/products/class-scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,16 @@ public static function get_features() {
return array();
}

/**
* Get the product princing details
*
* @return array Pricing details
*/
public static function get_pricing_for_ui() {
return array(
'available' => true,
'is_free' => true,
);
}

}
13 changes: 13 additions & 0 deletions projects/packages/my-jetpack/src/products/class-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,17 @@ public static function get_features() {
return array();
}

/**
* Get the product princing details
*
* @return array Pricing details
*/
public static function get_pricing_for_ui() {
return array(
'available' => true,
'currency_code' => 'EUR',
'full_price' => '4.50',
'promotion_percentage' => '50',
);
}
}
13 changes: 13 additions & 0 deletions projects/packages/my-jetpack/src/products/class-videopress.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,17 @@ public static function get_features() {
return array();
}

/**
* Get the product princing details
*
* @return array Pricing details
*/
public static function get_pricing_for_ui() {
return array(
'available' => true,
'currency_code' => 'EUR',
'full_price' => '9',
'promotion_percentage' => '50',
);
}
}
10 changes: 10 additions & 0 deletions projects/packages/my-jetpack/tests/php/class-broken-product.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,14 @@ public static function get_long_description() {
public static function get_features() {
return array();
}

/**
* Get the product pricing
*
* @return array
*/
public static function get_pricing_for_ui() {
return array();
}

}

0 comments on commit 4752c6c

Please sign in to comment.