Page 1 of 1

Where are suggestions going?

Posted: Tue Jun 15, 2021 4:33 pm
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

Re: Where are suggestions going?

Posted: Wed Jun 16, 2021 7:04 am
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.

Re: Where are suggestions going?

Posted: Wed Jun 16, 2021 12:24 pm
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.