Where are suggestions going?

Ask the community for help and support.
Post Reply
Greasemonkey
VIP Member
VIP Member
Posts: 13
Joined: Thu Apr 01, 2021 2:07 am
Has thanked: 4 times

Where are suggestions going?

Post by Greasemonkey »

Do suggestions go here or in Github?

Just a very small improvement - that was never made in all the years of OsC.

\includes\system\segments\checkout\insert_order.php (once upon a time checkout_process.php)

Change

Code: Select all

'payment_method' => $order->info['payment_method'],
To

Code: Select all

'payment_method' => strip_tags($order->info['payment_method']), 
To prevent any html etc being written to the DB that could be in the payment module title.

Example: using font awesome in the title of a module like:

Code: Select all

'<i class="fa fa-money text-primary"></i> COD'
Inserts to the DB as

Code: Select all

'<i class="fa fa-money text-primary"></i> COD
ecartz
Lead Developer
Lead Developer
Posts: 2637
Joined: Tue Nov 05, 2019 6:02 pm
Has thanked: 4 times
Been thanked: 181 times

Re: Where are suggestions going?

Post by ecartz »

It would likely make more sense to look at why you want to stick HTML into the payment method and find a replacement for that instead. I.e. that we should be looking to delete

Code: Select all

        $this->order->info['payment_method'] = $GLOBALS[$_SESSION['payment']]->public_title ?? $GLOBALS[$_SESSION['payment']]->title;
Then there would be no HTML in the payment method, which could then be used programmatically.

Or add a new column for the payment module and leave the HTML in the payment method.

The problem here seems to be that the payment method is used for two things:

1. Controlling how the payment method is displayed to the user.
2. Determining how payment was made.

That seems like two distinct uses. Rather than ping-ponging between optimizing one or the other, perhaps we should split them so that they can be optimized separately.
Greasemonkey
VIP Member
VIP Member
Posts: 13
Joined: Thu Apr 01, 2021 2:07 am
Has thanked: 4 times

Re: Where are suggestions going?

Post by Greasemonkey »

A simple use, as you can see in my example is using a Font Awesome icon for title display in checkout_payment.
Or add a new column for the payment module and leave the HTML in the payment method.

The problem here seems to be that the payment method is used for two things:

1. Controlling how the payment method is displayed to the user.
2. Determining how payment was made.
A new column would be fine - I think OsC a column for a gif/image - no? Not sure if that was removed?

I'll let you smart guys figure the best solution... I'm just a guy with enough coding (read - copy/paste) knowledge to be dangerous.
Post Reply