This commit is contained in:
Almira Krdzic
2018-09-19 10:52:59 +02:00
parent cae148ebce
commit 85deb1d9f8
11 changed files with 798 additions and 14 deletions

View File

@@ -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);