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

        jonathan Jonathan Reissmueller created issue -
        jonathan Jonathan Reissmueller made changes -
        Field Original Value New Value
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Description Update app/controllers/admin_company_billing.php starting at line 711 from:

        {code:java}

                $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);
        {code}

        To


        {code:java}

                $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]);
        {code}

        And update starting at line 897:

        {code:java}
                $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);
        {code}

        To


        {code:java}
                $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]);
        {code}



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

        {code:java}

                $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);
        {code}

        To


        {code:java}

                $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]);
        {code}

        And update starting at line 897:

        {code:java}
                $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);
        {code}

        To


        {code:java}
                $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]);
        {code}
        jonathan Jonathan Reissmueller made changes -
        Description Update app/controllers/admin_company_billing.php starting at line 711 from:

        {code:java}

                $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);
        {code}

        To


        {code:java}

                $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]);
        {code}

        And update starting at line 897:

        {code:java}
                $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);
        {code}

        To


        {code:java}
                $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]);
        {code}
        Update app/controllers/admin_company_billing.php starting at line 711 from:

        {code:java}

                $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);
        {code}

        To


        {code:java}

                $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]);
        {code}

        And update starting at line 897:

        {code:java}
                $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);
        {code}

        To

        {code:java}
                $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]);
        {code}

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

        {code:java}
                        case 'service':
        {code}

        To

        {code:java}
                        case 'domain':
                        case 'service':
        {code}


        jonathan Jonathan Reissmueller made changes -
        Sprint 5.2.0 Wrapup [ 142 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked lower
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Fix Version/s 5.2.0-b1 [ 11709 ]
        Fix Version/s Short Term [ 10800 ]
        abdy Abdy Franco made changes -
        Assignee Abdy Franco [ abdy ]
        abdy Abdy Franco made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        abdy Abdy Franco made changes -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        abdy Abdy Franco made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 1 hour, 22 minutes [ 4920 ]
        Worklog Id 15268 [ 15268 ]
        jonathan Jonathan Reissmueller made changes -
        Status In Review [ 5 ] Closed [ 6 ]

          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