Fix tests
This commit is contained in:
@@ -15,29 +15,23 @@ class Wiaas_Package_CL_Pricing {
|
||||
* @param array $cl_extras
|
||||
*/
|
||||
public static function set_extras($organization_id, $package_id, $cl_extras) {
|
||||
//self::_assign_catalogue_attribute_options($organization_id, $package_id, $cl_extras);
|
||||
|
||||
$has_extras = false;
|
||||
|
||||
foreach ($cl_extras as $extra_type => $cl_extra) {
|
||||
unset($cl_extra['type']);
|
||||
unset($cl_extra['customer']);
|
||||
|
||||
$has_extras = $has_extras || $cl_extra['visible'];
|
||||
|
||||
$cl_extras[$extra_type] = $cl_extra;
|
||||
}
|
||||
|
||||
$package = wc_get_product($package_id);
|
||||
$old_extras = self::get_extras($organization_id, $package_id);
|
||||
|
||||
$package->add_meta_data('_wiaas_catalogue_'.$organization_id, $has_extras ? 'yes' : 'no', true);
|
||||
$package->save_meta_data();
|
||||
|
||||
// Persist package catalogue extras
|
||||
// Persist package price extras
|
||||
update_term_meta(
|
||||
$organization_id,
|
||||
'_wiaas_cm_extras_'.$package_id,
|
||||
$cl_extras);
|
||||
|
||||
do_action('wiaas_package_prices_extras_set', $organization_id, $package_id, $cl_extras, $old_extras);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user