[Résolu] Woocommerce craque à 45 minutes du site live (Créer un compte)

  • WordPress :5.4
  • Statut : résolu
Affichage de 1 message (sur 1 au total)
  • Auteur
    Messages
  • #2349609
    nicemarketer
    Participant
    Initié WordPress
    12 contributions

    Bonjour,

    Ma configuration WP actuelle

    • Version de PHP/MySQL :
    • Thème utilisé : maison
    • Extensions en place :
    • Nom de l’hébergeur :
    • Adresse du site :

    Problème(s) rencontré(s) :

    Bonjour,

    J’éditais du css bien sagement puis pouf erreur critique, la hotline du host m’a dit que woocommerce est le plugin causant problème, je n’ai jamais eu de soucis auparavant, quand c’est apparu je n’installais pas de plugins, j’éditais via brackets filezilla du css.
    Voici le code

    <?php
    
    /**
     * SneakersOG functions and definitions
     *
     * @link https://developer.wordpress.org/themes/basics/theme-functions/
     *
     * @package SneakersOG
     */
    
    // Register Custom Navigation Walker
    require_once get_template_directory(). '/inc/class-wp-bootstrap-navwalker.php';
    
    /*require_once get_template_directory(). '/inc/customizer.php';*/
    /**
    * Enqueue scripts and styles.
    */
    
    function sneakersog_scripts(){
        wp_enqueue_script('bootstrap-js', get_template_directory_uri() . '/inc/bootstrap.min.js', array('jquery'), '4.5.0', true);
        
        wp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/inc/bootstrap.min.css', array(), '4.5.0', 'all' );
       
        wp_enqueue_style( 'sneakersog-style', get_stylesheet_uri(), array(), filemtime(get_template_directory() . '/style.css'), 'all' );
        
        wp_enqueue_style('google-fonts', 'https://fonts.googleapis.com/css2?family=Vidaloka&display=swap');
    }
     
    add_action('wp_enqueue_scripts', 'sneakersog_scripts');
    
    /**
    * Sets up theme defaults and registers support for various WordPress features.
    *
    * Note that this function is hooked into the after_setup_theme hook, which
    * runs before the init hook. The init hook is too late for some features, such
    * as indicating support for post thumbnails.
    */
    
    function sneakersog_config(){
        register_nav_menus(
            array(
                'sneakersog_main_menu' => 'SneakersOG Main Menu',
                'sneakersog_footer_menu' => 'SneakersOG Footer Menu',
            )
        );
        
        // This theme is WooCommerce compatible, so we're adding support to WooCommerce    
        add_theme_support('woocommerce', array(
            'thumbnail_image_width' => 200,
            'single_image_width' => 300,
            'product_grid'          => array(
                'default_rows'    => 6,
                'min_rows'        => 2,
                'max_rows'        => 20,
                'default_columns' => 4,
                'min_columns'     => 1,
                'max_columns'     => 20,
            ),
        ));
        add_theme_support('wc-product-gallery-zoom');
        add_theme_support('wc-product-gallery-lightbox');
        add_theme_support('wc-product-gallery-slider');
        add_theme_support('custom-logo', array(
            'height' => 451,
            'width' => 514,
            'flex_height' => true,
            'flex_width' => true,
        ));
        
        if ( ! isset ($content_width)){
            $content_width = 600; 
        }
        
    }
    
    
    
    add_action('after_setup_theme', 'sneakersog_config', 0);
    
    if(class_exists('WooCommerce')){
        require get_template_directory() . '/inc/wc-modifications.php';
    }
    
    // Supprimer le taux de compression JPEG de WordPress
    
    // On va retourner la valeur 100 ici. L'image sera donc celle d'origine (100%).
    add_filter( 'jpeg_quality', create_function( '', 'return 100;' ) );
    
    /**
     * Registers a widget area.
     *
     * @link https://developer.wordpress.org/reference/functions/register_sidebar/
     *
     */
    /*add_action( 'widgets_init', 'sneakersog_widget_init' );
        function sneakersog_widget_init(){
            register_sidebar(
                array(
                    'name' => 'SneakersOG Main Sidebar'
                    'id' => 'sneakersog-sidebar1',
                    'description' => 'Drag and drop your widgets here',
                    'before_widget' => '<section id="%1$s" class="widget %2$s"',
                    'after_widget' => '</section>',
                    'before_title' => '<h2 class="widget-title h5">',
                    'after_title' => '</h2>',
                )
            );
        }*/
    functions.php

    <?php
    /**
     * The header for our theme
     *
     * This is the template that displays all of the <head> section
     *
     * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
     *
     * @package Fancy Lab
     */
    ?>
    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    
    <head>
        <meta charset="<?php bloginfo( 'charset' ); ?>">
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <link rel="profile" href="https://gmpg.org/xfn/11" />
        <?php wp_head(); ?>
    </head>
    
    <body <?php body_class(); ?>>
        <div id="page" class="site">
            <header>
                <section>
                    <div class="container">
                        <div class="row">
                            <a href="<?php echo home_url( '/' ) ?>">
                                <?php if( has_custom_logo() ): ?>
                                <?php the_custom_logo(); ?>
                                <?php else: ?>
                                <p class="site-title"><?php bloginfo( 'title' ); ?></p>
                                <span><?php bloginfo( 'description' ); ?></span>
                                <?php endif; ?>
                            </a>
                        </div>
    
                    </div>
                </section>
                <section class="top-bar">
                    <div class="container">
                        <div class="col-6">
                            <nav class="main-menu navbar navbar-expand-md navbar-light" role="navigation">
                                <!--<div class="container">-->
                                <!-- Brand and toggle get grouped for better mobile display -->
                                <button class="navbar-toggler ml-auto" type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-controls="bs-example-navbar-collapse-1" aria-expanded="false" aria-label="<?php esc_attr_e( 'Toggle navigation', 'your-theme-slug' ); ?>">
                                    <span class="navbar-toggler-icon"></span>
                                </button>
                                <?php
                                            wp_nav_menu( array(
                                                'theme_location'    => 'sneakersog_main_menu',
                                                'depth'             => 3,
                                                'container'         => 'div',
                                                'container_class'   => 'collapse navbar-collapse',
                                                'container_id'      => 'bs-example-navbar-collapse-1',
                                                'menu_class'        => 'nav navbar-nav',
                                                'fallback_cb'       => 'WP_Bootstrap_Navwalker::fallback',
                                                'walker'            => new WP_Bootstrap_Navwalker(),
                                            ) );
                                            ?>
                            </nav>
                        </div>
                    </div>
                </section>
            </header>
    header.php

    /*
    Theme Name: SneakersOG.com
    Theme URI: https://www.sneakersog.com/
    Author: chaudsboys
    Author URI: https://www.sneakersog.com/
    Description: SneakersOG.com is a website for sneakers enthusiasts.
    Version: 1.0
    Text-domain: sneakersog.com
    License: GNU General Public License v2 or later
    License URI: http://www.gnu.org/licenses/gpl-2.0.html
    Tags: e-commerce, custom-menu, custom-logo, featured-images, footer-widgets, theme-options, translation-ready, blog, right-sidebar, sticky-post, threaded-comments
    */
    
    
    
    
    /* Header - Main Menu */
    .main-menu{
        padding: 0;
        background: green;
    }
    
    .main-menu ul{  
        padding: 0; 
        margin: 0; 
        font-size: 18px; 
        font-weight: 500; 
        border-radius: 0;    
    }
    
    .main-menu ul li{ 
        display: inline;  
        margin: 0 5px 0 0;
    }
    
    .main-menu ul li:last-child{ 
        margin: 0; 
    }
    
    .main-menu .dropdown:hover>.dropdown-menu,
    .main-menu .dropup:hover>.dropdown-menu {
        display: block;
    }
    
    .main-menu .navbar-toggler-icon {
        background-image: url('img/hamburger-menu.svg');
    }
    
    /* Search Form */
    /*.search-form button {
        background-image: url('img/search.svg');
        height: 23px;
        width: 23px;
        background-repeat: no-repeat;
        background-color: transparent;
        border: none;
    }
    
    .search-form input[type="search"]{
        background-color: #fff;
        border: 1px solid black;
        font-weight: 500;
        font-size: 110%;
        padding: 0.3rem 1rem;
        margin-right: 0.3rem;
    }*/
    
    /* Footer - Footer Menu */
    .footer-menu ul, .footer-widgets ul{ 
        list-style: none; 
        padding: 0; 
        margin: 0; 
        font-size: 16px; 
    }
    
    .footer-menu ul li{ 
        display: inline; 
        margin: 0 10px 0 0;
    }
    
    .footer-menu ul li:last-child{ 
        margin: 0; 
    }
    
    .footer-menu ul li a{ 
        color: #939393; 
        text-decoration: none;
    }
    
    .footer-menu ul li.current-menu-item a{ 
        color: #ff9292; 
    }
    
    
    /* WooCommerce */
    
    /* Grid System */
    .woocommerce .col2-set .col-1,
    .woocommerce .col2-set .col-2{
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    @media all and (max-width: 767px) {
    
        .woocommerce .col2-set .col-1,
        .woocommerce .col2-set .col-2{
            flex: 0 0 100%;
            max-width: 100%;
        }
    
    }
    
    #sidebar,
    .sidebar-shop,{
        display: none;
    }
    
    
    /* Shop */
    
    .shop-content{
        padding: 3rem 0;
    }
    
    .shop-content .row{
        margin-left: 0;
        margin-right: 0;
    }
    
    .post-type-archive-product .content-area, 
    .product-template-default .content-area,
    .tax-product_cat .content-area{
        padding: 0;
    }
    
    .woocommerce .woocommerce-breadcrumb a {
        font-weight: 700;
    }
    
    .woocommerce ul.products.columns-1 li.product:first-child, 
    .woocommerce-page ul.products.columns-1 li.product:first-child {
        margin-top: 20px;
    }
    
    .woocommerce .products ul, 
    .woocommerce ul.products {
        border-bottom: 1px solid #eee;
    }
    
    .woocommerce ul.products li.product a img {
        width: 255px;
        height: auto;
        display: block;
        margin: 0 1em 1em 0;
        box-shadow: none;
        float: left;
    }
    
    .woocommerce ul.products li.product .woocommerce-loop-product__title{
        font-size: 20px;
        font-weight: 400;
        color: #000;
        margin: 0;
        padding: 0;
        display: table;
        
    }
    
    .post-type-archive-product .woocommerce-loop-product__title{
        margin-bottom: 0.5rem !important;
        text-transform: capitalize;
    }
    
    .woocommerce ul.products li.product .button {
        margin-top: 10px;
        background-color: #6d1272;
    }
    
    .woocommerce ul.products li.product .price{
        color: #000;
        font-weight: 400;    
    }
    
    .woocommerce ul.products li.product .price ins {
        font-size: 140%;
    }
    
    /*
    .woocommerce ul.products li.product .onsale{
        top: 16px;
        left: 0;
        right: 0;
        transform: rotate(90deg);
        border-radius: 0;   
        width: 83px;
        padding: 0;
        background-color: #D2335B;
        margin: 0;
        font-weight: 400;
    }
    
    .woocommerce ul.products li.product .onsale:before {
        content: "";
        position: absolute;
        top: 0;
        left: 83px;
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 24px 22px 0 0;
        border-color: #D2335B transparent transparent transparent;
    }
    
    .woocommerce ul.products li.product .onsale:after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 83px;
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 0 22px 24px 0;
        border-color: transparent transparent #D2335B transparent;
    }
    
    .woocommerce nav.woocommerce-pagination ul li a, 
    .woocommerce nav.woocommerce-pagination ul li span{
        color: #000;
    }
    
    .woocommerce nav.woocommerce-pagination ul li a, 
    .woocommerce nav.woocommerce-pagination ul li span {
        padding: 12px;
    }
    */
    
    
    /* Single Product */
    .woocommerce #respond input#submit.alt, 
    .woocommerce a.button.alt, 
    .woocommerce button.button.alt, 
    .woocommerce input.button.alt,
    .woocommerce ul.products li.product .button {
        background-color: #6d1272;
        color: #fff;
    }
    
    .woocommerce #respond input#submit.alt:hover, 
    .woocommerce a.button.alt:hover, 
    .woocommerce button.button.alt:hover, 
    .woocommerce input.button.alt:hover,
    .woocommerce ul.products li.product .button:hover {
        background-color: #4b0651;
    }
    
    .product_meta > span{
        display: block;
    }
    
    .woocommerce div.product p.price del, 
    .woocommerce div.product span.price del,
    .woocommerce ul.products li.product .price del .woocommerce-Price-amount{
        color: #000;
        font-size: 20px;
        font-weight: 500;
    }
    
    .woocommerce div.product p.price ins, 
    .woocommerce div.product span.price ins, 
    .woocommerce-Price-amount {
        font-size: 25px;
        color: #000;
        font-weight: 700;
    }
    
    
    /*.woocommerce span.onsale{
        top: 19px;
        left: 35px;
        transform: rotate(90deg);
        border-radius: 0;   
        width: 84px;
        padding: 0;
        background-color: #D2335B;
        margin: 0;
        font-weight: 400;
    }
    
    .woocommerce span.onsale:before {
        content: "";
        position: absolute;
        top: 0;
        left: 83px;
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 23px 22px 0 0;
        border-color: #D2335B transparent transparent transparent;
    }
    
    .woocommerce span.onsale:after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 83px;
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 0 22px 23px 0;
        border-color: transparent transparent #D2335B transparent;
    }*/
    
    .woocommerce div.product .woocommerce-tabs ul.tabs{
        padding: 0;
    
    }
    
    .woocommerce div.product .woocommerce-tabs ul.tabs li{
        border-radius: 0;
        margin: 0;
    }
    
    .woocommerce div.product .woocommerce-tabs ul.tabs li::after, 
    .woocommerce div.product .woocommerce-tabs ul.tabs li::before{
        content: none;
    }
    
    .woocommerce #respond input#submit, 
    .woocommerce a.button, 
    .woocommerce button.button, 
    .woocommerce input.button{
        background-color: #ffeb8a;
    }
    
    .woocommerce #respond input#submit:hover, 
    .woocommerce a.button:hover, 
    .woocommerce button.button:hover, 
    .woocommerce input.button:hover{
        background-color: #ffe252;
    }
    
    /* Cart */
    
    .woocommerce-cart table.cart td.actions .coupon .input-text{
        width: 150px;
    }
    
    
    /* Checkout */
    .woocommerce form .form-row {
        display: block;
    }
    .woocommerce-checkout #customer_details{
        margin-bottom: 20px;
    }
    .woocommerce table.shop_table{
        border-collapse: collapse;
    }
    .woocommerce table.shop_table thead{
        background-color: #6d1272;
        color: #fff;
    }
    
    
    /* General */
    
    .size-auto, 
    .size-full,
    .size-large,
    .size-medium,
    .size-thumbnail {
        max-width: 100%;
        height: auto;
    }

Affichage de 1 message (sur 1 au total)
  • Vous devez être connecté pour répondre à ce sujet.