Support

Home Forums Event Espresso Premium Transactions screen column widths and value of transaction id (txn_id)

Transactions screen column widths and value of transaction id (txn_id)

Posted: February 14, 2020 at 6:01 am

Viewing 10 reply threads


codingforsail

February 14, 2020 at 6:01 am

Hi

In the Event Espresso Transactions screen in the admin area, the column widths look strange.

The ID field seems to be two characters wide, the Actions column is about half the width it needs to be, yet there is a huge amount of white space between the Events column and the Actions column.

Is there any way that I can control the column widths?

Separately, I understand that the txn_id is generated from the database. On my testing site, which I recreate frequently with development changes, it has jumped from 818 to 9004111222139473. Has the number changed with any recent version of EE?

I hope not as the client requests that this number be used in the payment reference for bank transfers.

If not please can you tell me how to check the sequence value in the development database so that I can be assured it won’t end up like this when I go live with the changes.

Kind regards,

Anita


Tony

  • Support Staff

February 14, 2020 at 6:37 am

Hi Anita,

The ID field seems to be two characters wide, the Actions column is about half the width it needs to be, yet there is a huge amount of white space between the Events column and the Actions column.

That doesn’t sound normal, can you add a screenshot that shows what you can see?

https://eventespresso.com/wiki/troubleshooting-checklist/#screenshots

Separately, I understand that the txn_id is generated from the database. On my testing site, which I recreate frequently with development changes, it has jumped from 818 to 9004111222139473. Has the number changed with any recent version of EE?

The way in which we generate the txn_id has not changed, it is ID for each row in the database and autoincremented (within the database itself) each time a new row is added.

Jumping from 818 to 9004111222139473 would normally indicate something has been hitting the site continuously generating new Transactions, is the test site publicly accessible?

I hope not as the client requests that this number be used in the payment reference for bank transfers.

Just to check we are referring to the same value here, how are you sending/displaying that ID to the user?

If not please can you tell me how to check the sequence value in the development database so that I can be assured it won’t end up like this when I go live with the changes.

In short, you can’t stop the ID from doing the same as above, each time a transaction is added to the database, it will autoincrement the ID.


Josh

  • Support Staff

February 14, 2020 at 7:00 am

Hi,

You can change the column widths using CSS. A good way to add custom CSS to an admin page is via the wp_add_inline_style() function that’s provided by WordPress. Here’s an example code snippet that shows how to use the function to add custom styles to your Transactions admin page:

https://gist.github.com/joshfeck/3408b6d0dd6b81f8b88a5b81e6c5a8ca

You can add the above to a functions plugin.

With regards to the TXN ID, those are incremented by 1 each times there’s a transaction. For example, the very first transaction will have an ID of 1, then the second transaction will have an ID of 2. This hasn’t changed.

I do not know what you have going on within your development site. If it’s a matter of having testing data then that data would be best not be pushed to the live site.


codingforsail

February 15, 2020 at 6:57 am

Hi Tony,

The screenshot is here: http://wordpress-201401-1087397.cloudwaysapps.com/wp-content/uploads/screenshot_20200215_133053.jpg

The dev and test sites are publicly accessible; maybe I should password-protect them but it’s a pain.

We are displaying the ID on invoices that are generated. In the message template for invoice, it’s the one called TXN_ID.

Hi Josh,

Thanks for the action filter details.

My development site is a clone of the live site; each database change that is made to the development site is tracked using triggers on the database tables. I’ll be able to apply those changes to the live site, and it will handle the ID changes it needs. I don’t add any test data to this site.
I have a staging environment set-up to create a new site with development changes. This is for testing purposes and the client and I can add test data there without fear of breaking anything. It is regularly overwritten.

Kind regards,

Anita


Tony

  • Support Staff

February 17, 2020 at 3:08 am

The screenshot is here: http://wordpress-201401-1087397.cloudwaysapps.com/wp-content/uploads/screenshot_20200215_133053.jpg

Ahh, yeah it is and it’s due to the screen size although we likely improve this some.

We are displaying the ID on invoices that are generated. In the message template for invoice, it’s the one called TXN_ID.

Thank you, we are referring to the same value.

My development site is a clone of the live site; each database change that is made to the development site is tracked using triggers on the database tables. I’ll be able to apply those changes to the live site, and it will handle the ID changes it needs. I don’t add any test data to this site.

So no data is manually added to the development site?


codingforsail

February 17, 2020 at 7:14 am

Ok I’ll have a go with the css that Josh suggested.

No, I don’t intentionally add data to the development site. The ID value is very high on there, though I can’t see why yet.

Kind regards,

Anita


codingforsail

February 17, 2020 at 9:52 am

Can’t make the CSS work. Can you check it for me please? The plugin is object-oriented, and I am also trying to hide the Venues filter on the Events page as they only have one venue:

My callback function:

    public function custom_css_for_ee_admin()
    {
        $css_txn = '.column-TXN_ID {  # have also tried with .transactions class
                width: 6%;
            }
            .transactions .column-TXN_timestamp {
                width: 16%;
            }
            .transactions .column-actions {
                width: 16%;
            }
            .transactions .column-events {
                width: 20%;
            }';
        wp_add_inline_style('espresso_txn', $css_txn);
        #
        $css_event = '#venue {display: none;}';
        wp_add_inline_style('event-admin-css', $css_event); #is this the right style?
    }
    #

The line in my constructor:

        add_action('admin_enqueue_scripts', array($this,'custom_css_for_ee_admin', 20) );


Tony

  • Support Staff

February 17, 2020 at 2:53 pm

The above works for me just by adding it to the themes functions.php file as a quick test.

You’ll need the .transactions class to make sure you rules are more specific and therefor overrule the others.

#venue {display: none;} is going to target more than just the dropdown, you could use select#venue or, hook in using PHP and remove the Venue filter before its output to the page rather than hiding it.

However, with your current set up, where are you getting event-admin-css from? That’s not a handle EE4 uses but I think you meant 'events-admin-css'


codingforsail

February 19, 2020 at 8:41 am

If I change the priority of the callback to 10 from 20 and output the css values, I see them being set. But there’s no effect on the actual screen. I must have something else going on if it is working for you.

I got the correct events-admin-css from the source code of event-espresso-core-reg\admin_pages\events\Events_Admin_Page.core.php and then mis-typed it.


Josh

  • Support Staff

February 19, 2020 at 11:59 am

There might be some other styles on your site that are overriding things. The code works on my site locally too.


codingforsail

March 5, 2020 at 6:52 am

I haven’t got the CSS to work, but wanted to give you an update on why the transaction id value was so high.

During development, I was using a plugin to synchronise database changes called WPMerge. One of the changes it made was to increase the txn_id to distinguish between changes made on the live system and changes made on the development system. When I put the development live, these changes were reverted.

Kind regards,

Anita

Viewing 10 reply threads

The support post ‘Transactions screen column widths and value of transaction id (txn_id)’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso