Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-4453

Coupons can't be applied to hidden packages

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2.0-b1
    • Component/s: None
    • Labels:
      None

      Description

      Update app/controllers/admin_company_billing.php starting at line 711 from:

      
              $package_groups = $this->Form->collapseObjectArray(
                  $this->Packages->getAllGroups($this->company_id),
                  'name',
                  'id'
              );
              $all = ['' => Language::_('AdminCompanyBilling.addcoupon.text_all', true)];
              $package_groups = $all + $package_groups;
              $package_attributes = [];
              $packages = $this->Packages->getAll($this->company_id);
      
              // Build the package option attributes
              foreach ($packages as $package) {
                  $groups = $this->Packages->getAllGroups($this->company_id, $package->id);
      

      To

      
              $package_groups = $this->Form->collapseObjectArray(
                  $this->Packages->getAllGroups($this->company_id, null, null, ['hidden' => 1]),
                  'name',
                  'id'
              );
              $all = ['' => Language::_('AdminCompanyBilling.addcoupon.text_all', true)];
              $package_groups = $all + $package_groups;
              $package_attributes = [];
              $packages = $this->Packages->getAll($this->company_id, [], null, null, ['hidden' => 1]);
      
              // Build the package option attributes
              foreach ($packages as $package) {
                  $groups = $this->Packages->getAllGroups($this->company_id, $package->id, null, ['hidden' => 1]);
      

      And update starting at line 897:

              $package_groups = $this->Form->collapseObjectArray(
                  $this->Packages->getAllGroups($this->company_id),
                  'name',
                  'id'
              );
              $all = ['' => Language::_('AdminCompanyBilling.editcoupon.text_all', true)];
              $package_groups = $all + $package_groups;
              $package_attributes = [];
              $packages = $this->Packages->getAll($this->company_id);
      
              // Build the package option attributes
              foreach ($packages as $package) {
                  $groups = $this->Packages->getAllGroups($this->company_id, $package->id);
      

      To

              $package_groups = $this->Form->collapseObjectArray(
                  $this->Packages->getAllGroups($this->company_id, null, null, ['hidden' => 1]),
                  'name',
                  'id'
              );
              $all = ['' => Language::_('AdminCompanyBilling.editcoupon.text_all', true)];
              $package_groups = $all + $package_groups;
              $package_attributes = [];
              $packages = $this->Packages->getAll($this->company_id, [], null, null, ['hidden' => 1]);
      
              // Build the package option attributes
              foreach ($packages as $package) {
                  $groups = $this->Packages->getAllGroups($this->company_id, $package->id, null, ['hidden' => 1]);
      

      In core/Pricing/Presenter/Items/Service/AbstractServiceItems.php change line 508 and 526 from:

                      case 'service':
      

      To

                      case 'domain':
                      case 'service':
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            abdy Abdy Franco
            Reporter:
            jonathan Jonathan Reissmueller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              23/Sep/21

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 hour, 22 minutes
              1h 22m

                Agile