Fixed Payment Profile titles not working as described

DragonByte Tech

Well-known member
Affected version
2.0.2
In the description for the "Display title" it says "Enter a name for this payment profile to be shown to users when purchasing products with this profile. If no display title is entered, the profile title above will be used instead."

This is not how it works. In the code - return ($e->display_title ?: $e->Provider->title); - it does not revert to the profile title but instead to the provider title.

Proposed patch:
PHP:
        $language = \XF::language();

        /** @var \XF\Repository\Payment $paymentRepo */
        $paymentRepo = $this->repository('XF:Payment');
        $profiles = $paymentRepo->findPaymentProfilesForList()
            ->pluckFrom(function ($e) use ($language)
            {
                return ($e->display_title ?: $e->title) . ' ' . $language['parenthesis_open'] . $e->Provider->title . $language['parenthesis_close'];
            })
            ->fetch();


Fillip
 
Back
Top Bottom