Меню

Woocommerce после оформления заказа ошибка 404

  • #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

IsaevDimka

Стала возникать ошибка 404 при оформлении заказа
5a38db588dd26471019065.png

ссылка вида → https://site.ru/checkout/order-received/7862?key=w…

Заказ приходит на почту и успешно оформляется в админке, но вот стала выскакивать такая ошибка. Не знаю уже что сделать. Много работы сделали откатывать через Git и старую базу это последний вариант решения проблемы. Надеюсь у кого-нибудь тоже была такая проблема.


  • Вопрос задан

    более трёх лет назад

  • 539 просмотров

Пригласить эксперта

А не смотрели случайно Woocommerce endpoints. Иногда такая фигня из-за них бывает.


  • Показать ещё
    Загружается…

29 янв. 2023, в 03:07

300000 руб./за проект

29 янв. 2023, в 02:16

700000 руб./за проект

29 янв. 2023, в 01:54

5000 руб./за проект

Минуточку внимания

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

Перейти к содержимому

WooCommerce 404 ошибка

В этой записи я подробно расскажу о том как исправить частую ошибку после установления WooCommerce на вашем WordPress сайте.

Проблема не в том, что у вас что-то не так с шаблоном (по крайней мере я так думал изначально), а в установке плагина.

После некоторых обширных поисков в интернете на английских ресурсах, я нашел замечательную тему, в которой говорилось о решении данной проблемы.

Чтобы исправить эту проблему, вам нужно пройти в админ центр, далее «Настройки» -> «Постоянные ссылки» (как на сркиншоте ниже).

woocommerce 404

После того как нажали на «Постоянные ссылки», вам нужно спуститься до заголовка «Постоянные ссылки товаров» и выбрать пункт «Произвольная база» и в поле справа вставить /tovar/%product_cat%.

Вместо tovar вы можете написать что хотите, например produkt. Но ни в коем случае не стоит трогать %product_cat%, так как именно это и поможет вам решить проблему с 404 в WooCommerce.

Теперь мы можете посмотреть как выглядит ваша ссылка. Это должно быть прмерно так: /tovar/{имя_категории}/{название_вашего_товара}/.

На этом все. Если у вас есть какие-либо вопросы — пожалуйста задавайте их ниже под записью.

Об авторе

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account


Closed

hoodzpah opened this issue

Oct 24, 2012

· 3 comments

Comments

@hoodzpah

Hi there,

I am having a similar 404 Error problem when i try and proceed from the cart to checkout. When I press checkout it takes me to a 404 error page.
I have tried:
• disabling all plugins, as former cases said SEO plugins were the cause of this.
• Checking that under the woocommerce settings tab «pages», the «pay page» is set to checkout->pay option.
• The checkout page does not have a parent attribute

After trying these, the 404 still occurred. I haven’t deleted any pages ater installing the woocommerce. I have woocommerce version 1.5.6 installed. I haven’t updated to the new version yet.

Thanks for any help!

@sweetpotatofrenchfry

I have something similar, not sure if I should be creating a new issue on this one…the 404 doesn’t show up for the whole page, only in the your order area in the bottom. Shows a 404 as if an imbedded page.

Also all my page settings are correct.
I have reverted back to the original theme (twenty eleven), and I have no other plugins installed.
I am running the newest version 1.7.0 though…which as I understand is the beta version and is unstable.

@mikejolley

Force SSL <- turn that off. Your server won’t be setup for it.

@hoodzpah

This was referenced

May 9, 2017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account


Closed

hoodzpah opened this issue

Oct 24, 2012

· 3 comments

Comments

@hoodzpah

Hi there,

I am having a similar 404 Error problem when i try and proceed from the cart to checkout. When I press checkout it takes me to a 404 error page.
I have tried:
• disabling all plugins, as former cases said SEO plugins were the cause of this.
• Checking that under the woocommerce settings tab «pages», the «pay page» is set to checkout->pay option.
• The checkout page does not have a parent attribute

After trying these, the 404 still occurred. I haven’t deleted any pages ater installing the woocommerce. I have woocommerce version 1.5.6 installed. I haven’t updated to the new version yet.

Thanks for any help!

@sweetpotatofrenchfry

I have something similar, not sure if I should be creating a new issue on this one…the 404 doesn’t show up for the whole page, only in the your order area in the bottom. Shows a 404 as if an imbedded page.

Also all my page settings are correct.
I have reverted back to the original theme (twenty eleven), and I have no other plugins installed.
I am running the newest version 1.7.0 though…which as I understand is the beta version and is unstable.

@mikejolley

Force SSL <- turn that off. Your server won’t be setup for it.

@hoodzpah

This was referenced

May 9, 2017

add_filter('woocommerce_get_checkout_order_received_url','my_order_received_url',0,2);
function my_order_received_url($return_url,$order){
    $return_url = str_replace('?','&',$return_url);
    $return_url = str_replace('/order-received/','/?order-received=',$return_url);
    return $return_url;
}

answered Mar 7, 2019 at 0:54

webofixer's user avatar

1

add_filter('woocommerce_get_checkout_order_received_url','my_order_received_url',0,2);
function my_order_received_url($return_url, $order){
    if( preg_match('~/order-received/d+?~', $return_url) ){
        $return_url = str_replace('?','&',$return_url);
        $return_url = str_replace('/order-received/','/?order-received=',$return_url);
    }
    return $return_url;
}

answered Mar 7, 2019 at 1:23

user11162784's user avatar

Check also Pages -> Checkout page if is published.
**
The page was Draft and that was the problem.

answered Apr 7, 2022 at 11:28

Catalin Tache's user avatar

add_filter('woocommerce_get_checkout_order_received_url','my_order_received_url',0,2);
function my_order_received_url($return_url,$order){
    $return_url = str_replace('?','&',$return_url);
    $return_url = str_replace('/order-received/','/?order-received=',$return_url);
    return $return_url;
}

answered Mar 7, 2019 at 0:54

webofixer's user avatar

1

add_filter('woocommerce_get_checkout_order_received_url','my_order_received_url',0,2);
function my_order_received_url($return_url, $order){
    if( preg_match('~/order-received/d+?~', $return_url) ){
        $return_url = str_replace('?','&',$return_url);
        $return_url = str_replace('/order-received/','/?order-received=',$return_url);
    }
    return $return_url;
}

answered Mar 7, 2019 at 1:23

user11162784's user avatar

Check also Pages -> Checkout page if is published.
**
The page was Draft and that was the problem.

answered Apr 7, 2022 at 11:28

Catalin Tache's user avatar

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Wolfsp exe ошибка приложения
  • Wolfenstein the old blood ошибка при запуске