-
#1

После обновления woocommerce пропала страница оформления заказа. Товар добавляется в корзину. Но при нажатие на корзину выбивает ошибку «404 страница не найдена».
http://www.velan-pack.com/checkout-2/
Последнее редактирование: 11 Май 2017
-
#7

Добрый день!
И каким образом Вы заново настроили ссылки?)
У меня та же история!
При редактировании страницы написано следующее:
Постоянная ссылка: http://daihido.com/checkout/
При переходе по ссылке, выдает следующий адрес: https://daihido.com/checkout/
Вместо http получается https !!!
Может в этом и есть причина???
Но, как устранить эту ошибку??
Нуждаюсь в вашей помощи!!!
Последнее редактирование: 26 Май 2017
Here’s the snippet, which I think may be causing the issue. Rest of the code does not do anything with permalinks..
add_action( 'admin_menu', 'register_lms_menu_page' ); function register_lms_menu_page(){ add_menu_page( 'Learning Management System', 'LMS', 'edit_posts', 'lms', 'vibe_lms_dashboard','',7 ); add_submenu_page( 'lms', 'Statistics', 'Statistics', 'edit_posts', 'lms-stats', 'vibe_lms_stats' ); add_submenu_page( 'lms', 'Settings', 'Settings', 'manage_options', 'lms-settings', 'vibe_lms_settings' ); //admin.php?page=lms // add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function ) } /*== PORTFOLIO == */ if(!function_exists('register_lms')){ function register_lms($init=NULL) { register_post_type( 'course', array( 'labels' => array( 'name' => 'Courses', 'menu_name' => 'Courses', 'singular_name' => 'Course', 'add_new_item' => 'Add New Course', 'all_items' => 'All Courses' ), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'capapbility_type' => 'post', 'has_archive' => true, 'show_in_menu' => 'lms', 'show_in_nav_menus' => true, 'taxonomies' => array( 'course-cat'), 'supports' => array( 'title','editor','thumbnail','author','comments','excerpt','revisions'), 'hierarchical' => true, 'show_in_nav_menus' => true, 'rewrite' => array( 'slug' => 'course', 'hierarchical' => true, 'with_front' => false ) ) ); if(isset($init) && $init) // Run only once when the Plugin is activated flush_rewrite_rules( false ); register_taxonomy( 'course-cat', array( 'course'), array( 'labels' => array( 'name' => 'Category', 'menu_name' => 'Category', 'singular_name' => 'Category', 'add_new_item' => 'Add New Category', 'all_items' => 'All Categories' ), 'public' => true, 'hierarchical' => true, 'show_ui' => true, 'show_in_menu' => 'lms', 'show_admin_column' => true, 'query_var' => 'course-cat', 'show_in_nav_menus' => true, 'rewrite' => array( 'slug' => 'course-cat', 'hierarchical' => true, 'with_front' => false ), ) ); register_post_type( 'unit', array( 'labels' => array( 'name' => 'Units', 'menu_name' => 'Units', 'singular_name' => 'Unit', 'add_new_item' => 'Add New Unit', 'all_items' => 'All Units' ), 'public' => true, 'taxonomies' => array( 'module-tag'), 'publicly_queryable' => true, 'show_ui' => true, 'has_archive' => true, 'show_in_menu' => 'lms', 'show_in_nav_menus' => true, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'post-formats', 'revisions' ), 'hierarchical' => true, 'show_in_nav_menus' => false, 'rewrite' => array( 'slug' => 'unit', 'hierarchical' => true, 'with_front' => false ) ) ); if(isset($init) && $init) // Run only once when the Plugin is activated flush_rewrite_rules( false ); register_taxonomy( 'module-tag', array( 'unit'), array( 'labels' => array( 'name' => 'Tag', 'menu_name' => 'Tag', 'singular_name' => 'Tag', 'add_new_item' => 'Add New Tag', 'all_items' => 'All Tags' ), 'public' => true, 'hierarchical' => false, 'show_ui' => true, 'show_admin_column' => 'true', 'show_in_nav_menus' => true, 'rewrite' => array( 'slug' => 'module-tag', 'hierarchical' => true, 'with_front' => false ), ) ); register_post_type( 'quiz', array( 'labels' => array( 'name' => 'Quizes', 'menu_name' => 'Quizes', 'singular_name' => 'Quiz', 'all_items' => 'All Quizes' ), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'has_archive' => true, 'show_in_menu' => 'lms', 'show_in_nav_menus' => true, 'supports' => array( 'title','editor','thumbnail', 'revisions' ), 'hierarchical' => true, 'show_in_nav_menus' => false, 'rewrite' => array( 'slug' => 'quiz','hierarchical' => true, 'with_front' => false ) ) ); if(isset($init) && $init) // Run only once when the Plugin is activated flush_rewrite_rules( false ); register_post_type( 'question', array( 'labels' => array( 'name' => 'Question Bank', 'menu_name' => 'Question Bank', 'singular_name' => 'Question', 'all_items' => 'All Questions' ), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'has_archive' => true, 'show_in_menu' => 'lms', 'show_in_nav_menus' => true, 'supports' => array( 'title','editor', 'comments','revisions' ), 'hierarchical' => true, 'show_in_nav_menus' => false, 'rewrite' => array( 'slug' => 'question','hierarchical' => true, 'with_front' => false ) ) ); if(isset($init) && $init) // Run only once when the Plugin is activated flush_rewrite_rules( false ); register_taxonomy( 'question-tag', array( 'question'), array( 'labels' => array( 'name' => 'Tag', 'menu_name' => 'Tag', 'singular_name' => 'Tag', 'add_new_item' => 'Add New Tag', 'all_items' => 'All Tags' ), 'public' => true, 'hierarchical' => false, 'show_ui' => true, 'show_admin_column' => 'true', 'show_in_nav_menus' => true, 'rewrite' => array( 'slug' => 'question-tag', 'hierarchical' => false, 'with_front' => false ), ) ); add_post_type_support('question','comments'); /*====== Version 1.4 EVENTS =====*/ if ( in_array( 'wplms-events/wplms-events.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { flush_rewrite_rules( false ); register_post_type( 'wplms-event', array( 'labels' => array( 'name' => 'Events', 'menu_name' => 'Events', 'singular_name' => 'Event', 'add_new_item' => 'Add New Events', 'all_items' => 'All Events' ), 'public' => true, 'taxonomies' => array( 'event-type'), 'publicly_queryable' => true, 'show_ui' => true, 'has_archive' => true, 'show_in_menu' => 'lms', 'show_in_nav_menus' => true, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'post-formats', 'revisions' ), 'hierarchical' => true, 'show_in_nav_menus' => false, 'rewrite' => array( 'slug' => 'event', 'hierarchical' => true, 'with_front' => true ) ) ); flush_rewrite_rules( false ); register_taxonomy( 'event-type', array( 'wplms-event'), array( 'labels' => array( 'name' => 'Event type', 'menu_name' => 'Event type', 'singular_name' => 'Event type', 'add_new_item' => 'Add New Event type', 'all_items' => 'All Event types' ), 'public' => true, 'hierarchical' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => true, 'rewrite' => array( 'slug' => 'event-type', 'hierarchical' => true, 'with_front' => false ), ) ); add_post_type_support('wplms-event','comments'); } /*====== Version 1.3 RECORD PAYMENTS =====*/ register_post_type( 'payments', array( 'labels' => array( 'name' => 'Payments', 'menu_name' => 'Payments', 'singular_name' => 'Payment', 'add_new_item' => 'Add New Payment', 'all_items' => 'Payments History' ), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'has_archive' => false, 'show_in_menu' => 'lms', 'show_in_nav_menus' => false, 'supports' => array( 'title'), 'hierarchical' => false, 'rewrite' => array( 'slug' => 'payments', 'hierarchical' => false, 'with_front' => false ) ) ); if(isset($init) && $init) // Run only once when the Plugin is activated flush_rewrite_rules( false ); /*====== Version 1.3.2 CERTIFICATE TEMPLATES =====*/ register_post_type( 'certificate', array( 'labels' => array( 'name' => 'Certificate Template', 'menu_name' => 'Certificates Template', 'singular_name' => 'Certificate Template', 'add_new_item' => 'Add New Certificate', 'all_items' => 'Certificate Templates' ), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'has_archive' => false, 'show_in_menu' => 'lms', 'show_in_nav_menus' => false, 'supports' => array( 'title','editor'), 'hierarchical' => false, 'rewrite' => array( 'slug' => 'certificates', 'hierarchical' => false, 'with_front' => false ) ) ); if(isset($init) && $init) // Run only once when the Plugin is activated flush_rewrite_rules( false ); } } /*== Testimonials == */ if(!function_exists('register_testimonials')){ function register_testimonials($init=NULL) { register_post_type( 'testimonials', array( 'labels' => array( 'name' => 'Testimonials', 'menu_name' => 'Testimonials', 'singular_name' => 'Testimonial', 'all_items' => 'All Testimonials' ), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'supports' => array( 'title', 'editor','excerpt', 'thumbnail'), 'hierarchical' => false, 'has_archive' => true, 'menu_position' => 10, 'show_in_nav_menus' => false, 'rewrite' => array( 'slug' => 'testimonial', 'hierarchical' => true, 'with_front' => false ) ) ); if(isset($init) && $init) // Run only once when the Plugin is activated flush_rewrite_rules( false ); } } /*== Popups == */ if(!function_exists('register_popups')){ function register_popups($init=NULL) { register_post_type( 'popups', array( 'labels' => array( 'name' => 'Popups', 'menu_name' => 'Popups', 'singular_name' => 'Popup', 'all_items' => 'All Popups' ), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => false, 'supports' => array( 'title', 'editor','excerpt' ), 'hierarchical' => false, 'has_archive' => false, 'menu_position' => 8, 'show_in_nav_menus' => false, 'rewrite' => array( 'slug' => 'popup', 'hierarchical' => true, 'with_front' => false ) ) ); if(isset($init) && $init) // Run only once when the Plugin is activated flush_rewrite_rules( false ); } } add_action( 'init', 'register_lms' ); add_action( 'init', 'register_testimonials' ); add_action( 'init', 'register_popups' ); And I have this register_activation_hook(__FILE__,'custom_init'); function custom_init() { register_lms(1); register_popups(1); register_testimonials(1); }
I have tested this with Twentyfourteen and as soon as this code is active I start getting 404 on all the WooCommerce end-points
Viewing 1 replies (of 1 total)
Hi @fmosse ,
Thanks for reaching out!
I understand that customers are redirected to a 404 error page after completing their purchase, is this correct?
As a first step, can you navigate to WooCommerce → Settings → Advanced tab, and check that the Checkout Endpoint for Order received is correct:

If this is all good, please can you check if you have any redirection plugins currently enabled on your site. If so, can you temporarily deactivate this and see if this resolves the issue?
Also, I understand that you have refreshed the permalinks however, can you head over to Dashboard → Settings → Permalinks, and resave your existing settings, without making any changes to the settings.
Should the issue persist, please can you clarify if this issue occurs with all payment methods/gateways on your site, or if it is isolated to a specific one?
Lastly, please can you share the following with us so that we can have a better understanding of your sites current environment:
- System Status Report: navigate to WooCommerce → Status. Select
Get system reportand thenCopy for support. - Fatal Error log: Share a copy of any fatal error log found under WooCommerce → Status → Logs.
- Screenshot(s): Please share a screenshot(s) of the exact error you are seeing on your end, as well as a screenshot of your Checkout Endpoints.
Snipboard.io can be used for easily sharing screenshots – please follow the instructions on that page, then paste the URL in your reply.
Once you have these, please share them in your response here.
Cheers!
Viewing 1 replies (of 1 total)
Стала возникать ошибка 404 при оформлении заказа
ссылка вида → https://site.ru/checkout/order-received/7862?key=w…
Заказ приходит на почту и успешно оформляется в админке, но вот стала выскакивать такая ошибка. Не знаю уже что сделать. Много работы сделали откатывать через Git и старую базу это последний вариант решения проблемы. Надеюсь у кого-нибудь тоже была такая проблема.
-
Вопрос заданболее трёх лет назад
-
564 просмотра
Пригласить эксперта
А не смотрели случайно Woocommerce endpoints. Иногда такая фигня из-за них бывает.
-
Показать ещё
Загружается…
22 июн. 2023, в 11:00
200 руб./в час
22 июн. 2023, в 10:49
5000 руб./за проект
22 июн. 2023, в 10:00
2500 руб./за проект
Минуточку внимания
WooCommerce 404 errors can be common, especially when your plugin stack gets even mildly complex. One of the most common reasons for the 404 error is a failed automatic update or corrupt edit of the .htaccess file.
#!trpst#trp-gettext data-trpgettextoriginal=180#!trpen#Table of Contents#!trpst#/trp-gettext#!trpen#
Reasons for the WooCommerce 404 Error
- A corrupt .htaccess file caused by a plugin, WooCommerce or WordPress itself
- You’ve added a category or attribute with the base ‘/product/’ which is in conflict with WooCommerce Product Permalink settings
Solving a Corrupt .htacess File Causing WooCommerce 404 Error – Short Term
Many WooCommerce and WordPress plugins add code to the .htaccess file and interact with the code placed within it.
Your WordPress Caching Plugin will be adding caching directives…
Your WordPress Security Plugin will be adding security protocols, whitelisted IPs etc…
Your core WooCommerce settings will be adding directives for permalink structures etc…
There’s a whole list
The great news is there’s a VERY simple fix to the WooCommerce 404 error when it’s caused by a corrupt .htaccess file.
If you can still login to the backend of WordPress:
- Head to Settings > Permalinks
- Click “Save” at the bottom of the page (no need to change anything)
- Flush the Cache for good measure
- Verify the fix has worked in incognito / from a different Wifi connection
If you can’t login to the backend of WordPress:
- Head over to your host and login
- Go to the “file manager” section (exact location will differ depending on which WooCommerce Host you’re using)
- Make a copy of the .htaccess file
- Rename the old .htaccess file to something like .htaccess1
- Copy and paste a default WordPress .htaccess file from here into your new .htaccess file
- Save the new .htaccess file
- Flush the cache from the hosting dashboard (if you can)
- Verify the fix has worked in incognito / from a different Wifi connection
Solving a Corrupt .htaccess File Causing WooCommerce 404 Problem – Long Term
As the solution basically involves “Clicking Save” on the Permalinks settings page inside WordPress, this is definitely something that can be automated.
So…
All you need to do is add a cron job to flush the .htaccess file frequently to limit the time for which the error can actually occurr.
What the hell is a cron job you say?
Don’t panic – all you ACTUALLY need to do is add a code snippet using the “Code Snippets” plugin and click “Save and Activate” and you’re DONE. NO Code knowledge necessary – it’s child’s play.
Here’s the code you need to add:
// Flush permalinks every hour
add_action('my_hourly_event', 'do_this_hourly');
function my_activation() {
if ( !wp_next_scheduled( 'my_hourly_event' ) ) {
wp_schedule_event(time(), 'hourly', 'my_hourly_event');
}
}
add_action('wp', 'my_activation');
function do_this_hourly() {
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
Full credit for this code, and original source is isitwp.com – see the original code here
And here’s the code snippets plugin if you’ve not already got it installed:
Solving A Clash With A Category Or Attribute URL Base Causing WooCommerce 404 Error
As you’ll see on this drawn out thread on Github – this is more of a common caused of a WooCommerce 404 problem than I’d EVER have anticipated.
It basically means that an admin level user has intentionally created a “Post Category” or “Product Attribute” with the name “Product” – this means the slug for that category or attribute includes /product/ which is ALSO the default slug (permalink) for Product pages in WooCommerce.
This naturally leads to a conflict and means you’ve got a “human error” cause – and the technology hasn’t prevented that human error from occurring. Sometimes (a lot of the time) software just isn’t “poka yoke” and human error mistakes are allowed by the software when they shouldn’t be.
At some point in the future – this may well change and this error will become impossible – but for now, just watch out for rogue store owners and clients who could be causing some head scratching for you, the website manager!
