Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Dec 2007
    Posts
    5
    Plugin Contributions
    0

    help question Product sort order doesn't work- products display randomly!

    The products on both my store Homepage and Category pages are being displayed in a random sort order. I've tried changing the following values to no avail:

    -Congifuration > Layout Settings > Categories/Products Display Sort Order
    -Configuration> All Listing > Display Product Display - Default Sort Order

    I'm using a custom template and perhaps some where along the way, a piece of code was incorrectly manipulated. In my template file, under templates/tpl_modules_product_listing.php I see the following code:

    $new_products = $db->ExecuteRandomMulti($listing_sql, MAX_DISPLAY_NEW_PRODUCTS);

    $row = 0;
    $col = 0;
    $list_box_contents = array();
    $title = '';

    $num_products_count = $new_products->RecordCount();

    define('SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS', 4);
    // show only when 1 or more
    if ($num_products_count > 0) {
    if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS == 0 ) {
    $col_width = floor(100/$num_products_count);
    } else {
    $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS);
    }

    while (!$new_products->EOF) {

    $products_price = zen_get_products_display_price($new_products->fields['products_id']);

    $new_products->fields['products_name'] = zen_get_products_name($new_products->fields['products_id']);
    $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<div class="product_image"><a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a></div>') . '<div class="product_info"><span class="product_name"><a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a></span><span class="product_price">' . $products_price . "</span></div>");

    $col ++;
    if ($col > (SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS - 1)) {
    $col = 0;
    $row ++;
    }
    $new_products->MoveNextRandom();
    }

    /*if ($new_products->RecordCount() > 0) {
    if (isset($new_products_category_id) && $new_products_category_id != 0) {
    $category_title = zen_get_categories_name((int)$new_products_category_id);
    $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')) . ($category_title != '' ? ' - ' . $category_title : '' ) . '</h2>';
    } else {
    $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')) . '</h2>';
    }
    $zc_show_new_products = true;
    }*/
    }
    ?>

    <div id="productListing">
    <?php
    // only show when there is something to submit and enabled
    if ($show_top_submit_button == true) {
    ?>
    <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CART, BUTTON_ADD_PRODUCTS_TO_CART_ALT, 'id="submit1" name="submit1"'); ?></div>
    <br class="clearBoth" />
    <?php
    } // show top submit
    ?>

    <?php if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
    ?>
    <div id="productsListingTopNumber" class="navSplitPagesResult back"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></div>
    <div id="productsListingListingTopLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?></div>
    <br class="clearBoth" />
    <?php
    }
    ?>

    <?php
    /**
    * load the list_box_content template to display the products
    */
    //require($template->get_template_dir('tpl_tabular_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_tabular_display.php');
    require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php');
    ?>

    <?php if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
    ?>
    <div id="productsListingBottomNumber" class="navSplitPagesResult back"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></div>
    <div id="productsListingListingBottomLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></div>
    <br class="clearBoth" />
    <?php
    }
    ?>

    <?php
    // only show when there is something to submit and enabled
    if ($show_bottom_submit_button == true) {
    ?>
    <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CART, BUTTON_ADD_PRODUCTS_TO_CART_ALT, 'id="submit2" name="submit1"'); ?></div>
    <br class="clearBoth" />
    <?php
    } // show_bottom_submit_button
    ?>
    </div>

    <?php
    // if ($show_top_submit_button == true or $show_bottom_submit_button == true or (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 and $show_submit == true and $listing_split->number_of_rows > 0)) {
    if ($show_top_submit_button == true or $show_bottom_submit_button == true) {
    ?>
    </form>
    <?php } ?>
    Does anyone see any glaring issues as to why the products display randomly? I could really use some guidance from the ZC aficionados here...appreciate your help!

  2. #2
    Join Date
    Jun 2003
    Posts
    33,720
    Plugin Contributions
    0

    Default Re: Product sort order doesn't work- products display randomly!

    They display randomly because that is how those displays are designed.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Dec 2007
    Posts
    5
    Plugin Contributions
    0

    Default Re: Product sort order doesn't work- products display randomly!

    Hey Kim, what do you mean by that? I simply want my category index pages to be sorted by sort ID.

  4. #4
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Product sort order doesn't work- products display randomly!

    To change display order in category listing you need to edit:

    -Configuration> Product Listing > Display Product Listing Default Sort Order
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  5. #5
    Join Date
    Dec 2007
    Posts
    5
    Plugin Contributions
    0

    Default Re: Product sort order doesn't work- products display randomly!

    To change display order in category listing you need to edit:

    -Configuration> Product Listing > Display Product Listing Default Sort Order
    I set this value to 2a but that didnt seem to work.

    FYI heres the page I'm talking about: http://www.aplombclothing.com/store/...=index&cPath=1

  6. #6
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Product sort order doesn't work- products display randomly!

    Intersting, since your site seems to sort by random.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

 

 

Similar Threads

  1. v138a Search then Sort by Date - Doesn't Work?
    By limelites in forum General Questions
    Replies: 1
    Last Post: 27 Feb 2013, 05:51 PM
  2. Products do not display in sort order I want
    By ckosloff in forum Customization from the Admin
    Replies: 7
    Last Post: 12 Aug 2009, 05:06 AM
  3. Sort Order - Display Products by Quantity Available
    By calvinorr in forum General Questions
    Replies: 2
    Last Post: 18 Jan 2009, 01:19 AM
  4. Sort order and prev/next display doesn't match
    By reidwalley in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 31 Jul 2008, 11:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg