Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter audiomag

    (@audiomag)

    Yes i have clear all cache, plugin and wordpress and “Cache results” option is off.

    • This reply was modified 5 years, 2 months ago by audiomag.
    Thread Starter audiomag

    (@audiomag)

    Hello. I already have this active code in my function.php file.

    Unfortunately it does not work.

    Here is my function.php file :

    <?php
    add_action( ‘wp_head’, ‘add_my_google_analytics_code’, PHP_INT_MAX );
    function add_my_google_analytics_code() {
    ?>
    <!– Global site tag (gtag.js) – Google Analytics –>
    <script async src=”https://www.googletagmanager.com/gtag/js?id=UA-4216156-1″></script&gt;
    <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());

    gtag(‘config’, ‘UA-4216156-1’);
    </script>

    <?php
    }

    /**
    * RENOMER LA TAB ??MARQUE??
    */
    add_filter( ‘woocommerce_product_tabs’, ‘woo_rename_tabs’, 98 );
    function woo_rename_tabs( $tabs ) {

    $tabs[‘pwb_tab’][‘title’] = __( ‘Marque’ ); // Rename the description tab

    return $tabs;

    }

    /**
    * AFFICHER LES PRODUITS EN STOCK EN PREMIER V2.
    */

    add_action( ‘woocommerce_product_query’, ‘bbloomer_sort_by_stock_status_then_alpha’, 999 );

    function bbloomer_sort_by_stock_status_then_alpha( $query ) {
    if ( is_admin() ) return;
    $query->set( ‘meta_key’, ‘_stock_status’ );
    $query->set( ‘orderby’, array( ‘meta_value’ => ‘ASC’ ) );
    }

    /**
    * CHANGER LE NOMBRE DE PRODUITS APPARENTES
    */
    function woo_related_products_limit() {
    global $product;

    $args[‘posts_per_page’] = 6;
    return $args;
    }
    add_filter( ‘woocommerce_output_related_products_args’, ‘jk_related_products_args’, 20 );
    function jk_related_products_args( $args ) {
    $args[‘posts_per_page’] = 6; // 6 related products
    $args[‘columns’] = 3; // arranged in 2 columns
    return $args;
    }

    /**
    * FILTRE MOTEUR DE RECHERCHE – BACKORDER
    */

    add_filter( ‘aws_search_pre_filter_products’, ‘my_aws_search_pre_filter_products’ );
    function my_aws_search_pre_filter_products( $products_array ) {
    if ( $products_array && ! empty( $products_array ) ) {
    foreach ( $products_array as $key => $product ) {
    if ( $product[‘stock_status’] && isset( $product[‘stock_status’][‘status’] ) && $product[‘stock_status’][‘status’]) {

    $product_obj = wc_get_product( $product[‘id’] );

    if ( $product_obj->is_on_backorder() ) {
    $products_array[$key][‘stock_status’][‘text’] = ‘<span style=”color:#eaa600;”>’ . esc_html__( ‘Contactez nous’, ‘advanced-woo-search’ ) . ‘</span>’;
    }

    }
    }
    }
    return $products_array;
    }

    /**
    * RELEGER EN FIN DE RECHERCHE LES PRODUITS OUT OF STOCK DANS WOOCOMMERCE RECHERCHE DYNAMIQUE
    */

    add_filter( ‘aws_search_results_products’, ‘aws_search_results_products’ );
    function aws_search_results_products( $products ) {
    usort($products, function ($item1, $item2) {
    if ( isset( $item1[‘stock_status’][‘status’] ) && isset( $item2[‘stock_status’][‘status’] ) ) {
    if ( $item1[‘stock_status’][‘status’] ) {
    return -1;
    } else if ( $item2[‘stock_status’][‘status’] ) {
    return 1;
    } else {
    return 0;
    }
    } else {
    return 0;
    }
    });
    return $products;
    }

    Thread Starter audiomag

    (@audiomag)

    Close. thank you

    Thread Starter audiomag

    (@audiomag)

    That’s it, everything is perfect. It’s really great. Thank you so much for this precious help.

    Thread Starter audiomag

    (@audiomag)

    I found the first one by editing the code.
    I now just block on the css color.
    For that I cannot find alone.

    Thread Starter audiomag

    (@audiomag)

    A big thank you indeed there it works very well it is perfect.

    I have now 2 problematic little details.

    How to translate “backorder” into French?

    I did not find the term “backorder” in locotraslate.

    How to change your font color. I see that the css is the same as for in stock suddenly it changes me the color of “In stock” and “Backorder” simultaneously.

    If you could help me on these last two points I would be the happiest of men!

    Thread Starter audiomag

    (@audiomag)

    Hello, thanks for your reply.

    Unfortunately this currently does not really solve the problem in my case. Products whose orders are authorized while they are being restocked. Always displays the status in stock in green color while the message of the product sheet is: low stock in orange color with the message contact us.

    I miss this degree “backorder” between the “in stock” and the product “out of stock”.

    As this option is proposed by woocommerce I use it but without being able to match it to the way the plugin manages the display of stock.

    I hope there may be another solution!

    • This reply was modified 5 years, 2 months ago by audiomag.

    Ok Paulh267 thank you. I will wait for the next update.

    Ok same problem with the 3.1.2 I’m ok to test the beta 3.1.3 to give you a feedback. Have you a download link please ?

    Thank’s for your help but there is not really solution in your post or I don’t understand where is the solution. I actually try to import just aprice list and it is very very long. It import 10 rows simultaneously but is set to 1000 rows to import. I have tried all the configurations but nothing change to be better.

    +1 I have exactly the same problem. It is very long and I have errors messages like this.

    Something went wrong. We could not make a connection with the server. Check your permissions and rights the do ajax requests!

    Any Fix for this please ?

Viewing 11 replies - 1 through 11 (of 11 total)