Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Location
    SF Bay Area
    Posts
    867
    Plugin Contributions
    1

    Default [Done v1.3.10] Best Sellers link missing cPath param

    ZC 138 - newest. Bug Demo is new out of box and default demo database. No mods.

    Forgive if this has been posted, but I search many ways and not find any info.

    Anyway...

    When the Best sellers side box is displayed, the links are missing the cPath Param. This seems no big deal, but if you also display the category icon on the page, clicking on it takes you to the homepage instead of the category. You can see this clearly here:

    http://www.bellaknobs.com/test/

    and clicking on any of the Best Seller Links. The correct item will be displayed, but then click on the category icon will fail to display the category.

    Since I can't find any mention of this anywhere, I make small patch that makes this work right.

    Here is code that replace tpl_best_sellers.php

    <?php
    /**
    * Side Box Template
    *
    * @package templateSystem
    * @copyright Copyright 2003-2005 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_best_sellers.php 2982 2006-02-07 07:56:41Z birdbrain $
    */
    $content = '';
    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
    $content .= '<div class="wrapper">' . "\n" . '<ol>' . "\n";
    for ($i=1; $i<=sizeof($bestsellers_list); $i++) {
    // kiddo mod
    $cpath = zen_get_product_path($bestsellers_list[$i]['id']);

    $content .= '<li><a href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . "&cPath=" . $cpath . '">' . zen_trunc_string($bestsellers_list[$i]['name'], BEST_SELLERS_TRUNCATE, BEST_SELLERS_TRUNCATE_MORE) . '</a></li>' . "\n";
    }
    $content .= '</ol>' . "\n";
    $content .= '</div>' . "\n";
    $content .= '</div>';
    ?>

    Then this now makes the category icon link work properly since you pass the proper cPath arg.

    If this is already known or there is a better way to fix, sorry to waste your time.

    PS: I think I see this same problem with the Quick Reorder Box too.

    PPS: I can only leave the bug example install up a few days so if it's gone soon, sic transit gloria mundi.

  2. #2
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Best Sellers link missing cPath param

    This same bug was also brought up earlier this year and, since no patch has been yet issued, can only presume it will be corrected in a future release.

    Until then your workaround should be a good solution.

    Thanks for sharing.

  3. #3
    Join Date
    Jul 2006
    Location
    SF Bay Area
    Posts
    867
    Plugin Contributions
    1

    Default Re: Best Sellers link missing cPath param

    Thank you for the pointer to that other post. I look at that and see that the fix proposed there does seem to work better than fixing the individual sideboxes.

    But I am confused a bit too. In that post, Dr. Byte says that all the side boxen (except Best Sellers) have been updated in 138 to send the cPath arg.

    However, I see this missing in a number of side boxes including the Shopping Cart side box. I would think that is one of the more important side boxes.

    The tpl_modules_category_icon_display.php is coded to expect the cPath arg passed, but the other posters fix seems to negate the need for that with no ill effects. (but note I have not tested all possibilities)

    Below is the code complete with the more elegant fix from HiPCTech

    <?php
    /**
    * Module Template
    *
    * @package templateSystem
    * @copyright Copyright 2003-2007 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_modules_category_icon_display.php 6216 2007-04-17 06:09:57Z ajeh $
    */
    require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_CATEGORY_ICON_DISPLAY));

    ?>

    <div align="<?php echo $align; ?>" id="categoryIcon" class="categoryIcon"><?php echo '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $cPath, 'NONSSL') . '">' . $category_icon_display_image . $category_icon_display_name . '</a>'; ?></div>


    Thank you for the link and comment.

 

 

Similar Threads

  1. Best Sellers
    By purecp in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 8 Sep 2010, 02:11 AM
  2. Best Sellers
    By Renz in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 4 Jun 2009, 07:57 AM
  3. Best Sellers
    By crichw in forum General Questions
    Replies: 7
    Last Post: 3 Jul 2008, 12:51 PM
  4. Replies: 0
    Last Post: 17 Jan 2008, 12:37 AM
  5. Best Sellers
    By jovemac in forum General Questions
    Replies: 1
    Last Post: 23 Jul 2006, 11:34 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR