How to Change the Bill Screen URL
The bill screen is a separate page served from the OpenPOS plugin folder. On some hosting setups, direct access to files inside wp-content/plugins is restricted for security reasons, so the bill screen cannot be opened and the browser shows an error or a blank page instead. This guide shows how to move the bill screen to its own folder in your WordPress root and tell OpenPOS to use the new URL.
You will copy one folder, edit one line in a PHP file and add a small code snippet. The original files in the plugin stay where they are, so nothing inside OpenPOS itself is modified.
Before you start
- You need file access to your server, for example through FTP/SFTP or your hosting control panel’s file manager.
- You need to know the full server path of your WordPress installation (the folder that contains
wp-config.php). Your hosting control panel or your host’s support can tell you this path if you are not sure. - Take a backup of your site, or at least of your theme’s
functions.php, before adding code.
Steps to change the bill screen URL
- Copy the bill folder to your WordPress root. Copy the folder
your_wordpress/wp-content/plugins/woocommerce-openpos/billtoyour_wordpress/bill. Copy it, do not move it, so the plugin keeps its original files. - Set the WordPress base directory in the copied file. Open
your_wordpress/bill/index.phpin a text editor and find the lines shown below. ReplaceENTER_YOUR_WORDPRESS_BASE_PATHwith the full server path of your WordPress installation and uncomment the line by removing the#at the start. Save the file and upload it if you edited it locally.
/** UPDATE YOUR CUSTOM WORDPRESS DIR AT HERE */
# $base_dir = 'ENTER_YOUR_WORDPRESS_BASE_PATH'; // enter your custom wordpress base dir and uncomment
/** END */
- Tell OpenPOS to use the new bill URL. Add the code below to your theme’s
functions.php(preferably in a child theme, so a theme update does not remove it) or use any code snippet plugin. Changeyourwordpressdomainto your own WordPress domain, so the function returns the address of the new folder, for example your site address followed by/bill.
add_filter('op_bill_url',function(){
return 'yourwordpressdomain/bill'; // change to yourwordpressdomain to your wordpress domain
});
- Check the result. Open admin/pos/register and click bill screen on a register. The bill screen should now open from the new
/billaddress instead of the plugin folder.
Why this works
Hosting rules that block direct requests to the plugins folder usually do not apply to a normal folder in the WordPress root. By serving the bill screen from your_wordpress/bill, the page is requested from a location your host allows. The $base_dir line lets the copied file find your WordPress installation from its new location, and the op_bill_url filter makes OpenPOS link to the new address everywhere it opens the bill screen.
Troubleshooting
- The bill link still opens the old URL. Check that the snippet is active (the snippet plugin entry is enabled, or the code is in the functions.php of the theme that is actually active). Clear any page or server cache and reload the register page.
- The new URL shows an error or a blank page. Open
bill/index.phpagain and confirm that the$base_dirline is uncommented and the path points to the folder that contains your WordPress files. A typo in the path is the most common cause. - The new URL returns “404 Not Found”. Make sure the folder was copied to the WordPress root and is named exactly
bill, and that the domain in the snippet matches your site address (including https). - After updating OpenPOS. Your copied folder is not updated automatically. If the bill screen behaves differently after a plugin update, copy the
billfolder again and repeat step 2. - You see “403 Forbidden” on the POS itself. That is a different issue; see the related article below.
The same approach is used for the kitchen screen; the related article below explains that case.