EuroDomenii Posted November 27, 2021 Report Posted November 27, 2021 At /admin/settings/company/billing/addcoupon/ there’s no available domain package, since they are hidden. At admin/packages/ there’s a checkbox, allowing to ‘’Show Hidden Packages’’. This feature should be implemented also at coupon level? Thx! Quote
0 EuroDomenii Posted January 13, 2022 Author Report Posted January 13, 2022 Funny thing, I've done the following patch in the Blesta 5.1.3, which I should have published earlier, and on upgrade, I was surprised to find that an almost identical patch has already been included in Blesta 5.2.2 ? diff --git a/app/controllers/admin_company_billing.php b/app/controllers/admin_company_billing.php index 6a2fc65c..c6ef610a 100644 --- a/app/controllers/admin_company_billing.php +++ b/app/controllers/admin_company_billing.php @@ -716,7 +716,8 @@ class AdminCompanyBilling extends AppController $all = ['' => Language::_('AdminCompanyBilling.addcoupon.text_all', true)]; $package_groups = $all + $package_groups; $package_attributes = []; - $packages = $this->Packages->getAll($this->company_id); + $filters = ['hidden' => 1]; + $packages = $this->Packages->getAll($this->company_id, ['name' => 'ASC'], null, null, $filters); // Build the package option attributes foreach ($packages as $package) { @@ -901,8 +902,9 @@ class AdminCompanyBilling extends AppController ); $all = ['' => Language::_('AdminCompanyBilling.editcoupon.text_all', true)]; $package_groups = $all + $package_groups; - $package_attributes = []; - $packages = $this->Packages->getAll($this->company_id); + $package_attributes = []; + $filters = ['hidden' => 1]; + $packages = $this->Packages->getAll($this->company_id, ['name' => 'ASC'], null, null, $filters); // Build the package option attributes diff --git a/core/Pricing/Presenter/Items/Service/AbstractServiceItems.php b/core/Pricing/Presenter/Items/Service/AbstractServiceItems.php index db34a4d9..3def140a 100644 --- a/core/Pricing/Presenter/Items/Service/AbstractServiceItems.php +++ b/core/Pricing/Presenter/Items/Service/AbstractServiceItems.php @@ -497,7 +497,8 @@ abstract class AbstractServiceItems implements ServiceItemsInterface // Determine the currency from the item price $currency = null; switch ($meta['_data']['item_type']) { - case 'service': + case 'service': + case 'domain': $currency = (isset($meta['pricing']->currency) ? $meta['pricing']->currency : null); break; case 'option': @@ -515,8 +516,9 @@ abstract class AbstractServiceItems implements ServiceItemsInterface // Determine whether this item price can be discounted with this discount $discountItem = false; switch ($meta['_data']['item_type']) { - case 'service': - // Discount always applies to a service item that applies + case 'service': + case 'domain': + // Discount always applies to a service and domain item that applies $discountItem = true; break; case 'option': Quote
Question
EuroDomenii
At /admin/settings/company/billing/addcoupon/ there’s no available domain package, since they are hidden.
At admin/packages/ there’s a checkbox, allowing to ‘’Show Hidden Packages’’. This feature should be implemented also at coupon level?
Thx!
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.