Tests
This commit is contained in:
@@ -59,7 +59,7 @@ class Wiaas_Pricing {
|
||||
$total_item_cost = self::get_product_total_cost($product) * $bundled_item->get_quantity();
|
||||
|
||||
if (Wiaas_Product_Category::is_installation($product)) {
|
||||
$total_cost_per_category[$product_cat] += $total_cost_per_category[$product_cat] < $total_item_cost ?
|
||||
$total_cost_per_category[$product_cat] = $total_cost_per_category[$product_cat] < $total_item_cost ?
|
||||
$total_item_cost :
|
||||
$total_cost_per_category[$product_cat];
|
||||
} else {
|
||||
|
||||
@@ -11,7 +11,7 @@ class Wiaas_Product_Pricing {
|
||||
|
||||
add_filter('woocommerce_get_price_html', array(__CLASS__, 'get_product_price_html'), 10, 2);
|
||||
|
||||
add_filter('woocommerce_bundled_item_price', array(__CLASS__, 'get_bundled_product_fixed_price'), 10, 4);
|
||||
add_filter('woocommerce_bundled_item_price', array(__CLASS__, 'get_product_fixed_price'), 10, 2);
|
||||
|
||||
add_filter('woocommerce_bundled_item_is_priced_individually', array(__CLASS__, 'is_bundled_product_price_fixed'), 10, 2);
|
||||
|
||||
@@ -32,7 +32,7 @@ class Wiaas_Product_Pricing {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if bunded product has fixed price
|
||||
* Checks if bundled product has fixed price
|
||||
* @param $is_priced_individually
|
||||
* @param $bundled_item
|
||||
*
|
||||
@@ -51,12 +51,10 @@ class Wiaas_Product_Pricing {
|
||||
* Retrives fixed price for bundled product
|
||||
* @param $price
|
||||
* @param $product
|
||||
* @param $discount
|
||||
* @param $bundled_item
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function get_bundled_product_fixed_price($price, $product, $discount, $bundled_item) {
|
||||
public static function get_product_fixed_price($price, $product) {
|
||||
if (self::_get_is_product_price_recurring($product)) {
|
||||
return 0;
|
||||
}
|
||||
@@ -108,6 +106,8 @@ class Wiaas_Product_Pricing {
|
||||
*/
|
||||
public static function set_product_price($product, $price, $is_recurring = false, $pay_period = 0) {
|
||||
$product->set_price($price);
|
||||
$product->set_regular_price($price);
|
||||
|
||||
self::_set_is_product_price_recurring($product, $is_recurring);
|
||||
self::_set_product_price_pay_period($product, $pay_period);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user