Home Forums Plugins Edit Orders Support [Resolved] If you get a blank page on edit order or manual order…

Welcome to our community support forums! We're here to help - but if you have an urgent request for a Pro Plugin, you will get a prioritised response through our Premium Support page.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #29941

    I worked through with die to find this. This is to do with caching crashing as the plugin rather madly loads all products and we have 5000 plus.

    So edit wp-e-commerce-edit-orders/includes/release-3.8.php

    Change wpsc_eo_return_products:

     $products = (array)get_posts( array(
                            'post_type' => $post_type,
                            'numberposts' => -1,
                            'post_status' => 'publish',
                            'orderby' => 'menu_order',
                            'order' => 'ASC'
                    ) );

    to

     $products = (array)get_posts( array(
                            'post_type' => $post_type,
                            'numberposts' => -1,
                            'post_status' => 'publish',
                            'orderby' => 'menu_order',
                            'order' => 'ASC',
                           <strong> 'cache_results' => false,</strong>
                    ) );

    Of course, this would be better if they hadn’t done this and made the product drop down entirely based on type-through with a limit….

    #29942

    And for manual ordering, edit the following function:

    function wpsc_mo_return_products() {

    $post_type = ‘wpsc-product’;
    $products = (array)get_posts( array(
    ‘post_type’ => $post_type,
    ‘numberposts’ => -1,
    ‘post_status’ => ‘publish’,
    ‘orderby’ => ‘menu_order’,
    ‘order’ => ‘ASC’
    ) );
    $size = count( $products );
    for( $i = 0; $i < $size; $i++ ) {
    $products[$i]->name = $products[$i]->post_title;
    $products[$i]->price = wpsc_currency_display( wpsc_calculate_price( $products[$i]->ID, null, true ) );
    $products[$i]->sku = get_product_meta( $products[$i]->ID, ‘sku’, true );
    if( !$products[$i]->sku )
    $products[$i]->sku = ‘-‘;
    $products[$i]->stock = get_product_meta( $products[$i]->ID, ‘stock’, true );
    }
    return $products;

    }

    to be:
    $products = (array)get_posts( array(
    ‘post_type’ => $post_type,
    ‘numberposts’ => -1,
    ‘post_status’ => ‘publish’,
    ‘orderby’ => ‘menu_order’,
    ‘order’ => ‘ASC’,
    ‘cache_results’ => false
    ) );

    *sigh*

    #30060
    Michael Visser
    Keymaster

    Hi David, thanks for catching those optimisations. We’ve cooked them into the next release.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] If you get a blank page on edit order or manual order…’ is closed to new replies.