Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2008
    Location
    Toronto
    Posts
    347
    Plugin Contributions
    0

    Default "Specials" sidebox showing only for certain categories?

    Hello Everyone,

    I would like to create a 'Sales' sidebox that shows only when the customer is looking at products in a specified category. Is there an easy way to make this happen in Zen Cart? I searched for a plugin that would achieve this but I don't see one available.

    Any comments or help would be appreciated.

    We're using Zen 139h.

    Thank you!

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Re: "Specials" sidebox showing only for certain categories?

    First, copy /includes/templates/template_default/sideboxes/tpl_specials.php to /includes/templates/YOUR_TEMPLATE/sideboxes/tpl_specials.php and then edit the copied file to add the lines in red:
    Code:
    <?php
    /**
     * Side Box Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2011 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_specials.php 18698 2011-05-04 14:50:06Z wilt $
     */
    $specialCategories = 'list_all_categories_you_want_the_sidebox_displayed_on'; /* ... separated by commas, no intervening blanks */
    if ($current_page_base == FILENAME_PRODUCT_INFO && in_array($cPath, explode(',', $specialCategories))) {
      $content = "";
      $content .= '<div class="sideBoxContent centeredContent">';
      $specials_box_counter = 0;
      while (!$random_specials_sidebox_product->EOF) {
        $specials_box_counter++;
        $specials_box_price = zen_get_products_display_price($random_specials_sidebox_product->fields['products_id']);
        $content .= "\n" . '  <div class="sideBoxContentItem">';
        $content .= '<a href="' . zen_href_link(zen_get_info_page($random_specials_sidebox_product->fields["products_id"]), 'cPath=' . zen_get_generated_category_path_rev($random_specials_sidebox_product->fields["master_categories_id"]) . '&products_id=' . $random_specials_sidebox_product->fields["products_id"]) . '">' . zen_image(DIR_WS_IMAGES . $random_specials_sidebox_product->fields['products_image'], $random_specials_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
        $content .= '<br />' . $random_specials_sidebox_product->fields['products_name'] . '</a>';
        $content .= '<div>' . $specials_box_price . '</div>';
        $content .= '</div>';
        $random_specials_sidebox_product->MoveNextRandom();
      }
      $content .= '</div>' . "\n";
    }

  3. #3
    Join Date
    Dec 2008
    Location
    Toronto
    Posts
    347
    Plugin Contributions
    0

    Default Re: "Specials" sidebox showing only for certain categories?

    Thanks Lat9....I'll give this a try on Monday!

 

 

Similar Threads

  1. Replies: 3
    Last Post: 2 Dec 2010, 09:52 AM
  2. cutting certain categories from the "featured" and "new" products boxes
    By get bucked in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 6 Jan 2009, 08:58 AM
  3. Show "Units In Stock" for certain product only.
    By laydiefa in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 26 Nov 2008, 08:08 PM
  4. Have "Sale is final" text automatically show up for certain categories?
    By khopek in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 13 Feb 2008, 10:33 PM

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