- Product Types
- Adding Products
- One Time Pricing
- Subscription Pricing
- Subscription Trials Setup
- Installment Pricing
- Donation / Pay What You Want
- Inventory Management
- Product Variants
- Variant Images
- Digital Downloads
- Change Product Availability
- Hide Product from Shop Page
- Template Customization
- Product Collections
- First-Time Payment Discounts
- Manage Product Access
- Payment Types
- Free Trials & Setup Fees
- Create Product With Free Trials
- Charge Set Up Fee on Trials
- Product List
- Product Pages
- Create Product Page in Elementor
- Custom Buy Links
- Product SEO
- Change Permalinks
- Custom Fields
- Adding Products
- Test Mode
- Make Test Payments
- Edit & Customize Form
- Change Form Template
- Delete SureCart Forms
- Custom Checkout Form
- Add New Checkout Form
- Checkout Form With Gutenberg
- Checkout Form in Elementor
- Custom Thank You Page
- Create Donation Form
- Customize Confirmation Popup
- Include Coupons in URLs
- Pre-Fill Checkout Fields
- Change Checkout Texts
- Password Field in Checkout
- Default Country Code
- Add Terms to Checkout
- Conditional Block Checkouts
- Remove Coupon Field
- Hide Quantity Option
- Disable Quantity Editing
- Disable Item Removal
- Country Specific Purchases
- Fix View Order Button
- Fix Express Payment Buttons
- Fix PayPal Test Connection
- Fix PayPal Test Connection
- Fix Sign-In Loop
- Fix Order Confirmation Redirect
- Fix Divi Bullet Point Issue
- Fix Customer Dashboard
- Fix JSON Response Error
- Failed Payment Behavior
- Fix Stripe Zip Code Error
- Fix "Product Can’t Be Blank"
- Troubleshooting Guide
- PayPal IPN Warning Emails
- Caching Configuration for SureCart
- Why iDEAL Might Not Appear in Your CheckoutÂ
How to Hide/Change the Download Invoice Button on Your Customer Dashboard
For certain unique situations, you might prefer to use your own invoices or receipts, or even exclude SureCart’s default ones from the customer dashboard.
Here’s what the download invoice button looks like on your customer’s dashboard:
Fortunately, SureCart provides a PHP filter to do this. You just need to add this filter to your functions.php file.
You can use a code snippets plugin or integrate it through an alternative method to implement this change.
How to Add this Code to Your WordPress Site
In this article, we use this Code Snippets plugin to integrate the provided code into our functions.php file.
However, feel free to use any code snippet plugin you prefer.
- Copy the following code.
add_action(
'surecart/order/set_attribute',
function( $attribute, $name ) {
if ( 'statement_url' !== $name ) {
return $attribute;
}
return ''; // you can also customize this.
},
10,
2
);
- Navigate to your WordPress dashboard’s Functions (PHP) section under Snippets > All Snippets.
- Click on the Add New button at the top.
- Paste the copied code snippet in this box. You can also give a title and description for this snippet here.
- Once you’re done, click on the Save Changes and Activate button below.
Congrats! The snippet is now activated on your site.
Navigate to your customer dashboard now to see if the Download Receipt/Invoice button is still visible or not.
You can customize the above code to change the invoice URL according to your preferences.
That’s it! Hope this solution helped you. If you face any issues while integrating this code or still see the download button, please reach to our support team. We’re always here to help.
We don't respond to the article feedback, we use it to improve our support content.