Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2010
    Posts
    612
    Plugin Contributions
    0

    Default Complicated Sidebox Question....where are the pros?

    Hi Zenners!

    I have a bit of a complicated side box question...as stated. I have added the best sellers add on but I want the listings to be shown in the same layout as the featured products default sidebox. The coding is different and I'm not exactly sure where to make my adjustments and I don't want to end up messing things up. Any help would be greatly appreciated!


    Featured PHP Code
    PHP Code:
      $content "";
      
    $featured_box_counter 0;
      while (!
    $random_featured_product->EOF) {
        
    $featured_box_counter++;
        
    $featured_box_price zen_get_products_display_price($random_featured_product->fields['products_id']);
        
    $content .= '<div class="sideBoxContent centeredContent">';
        
    $content .=  '<a href="' zen_href_link(zen_get_info_page($random_featured_product->fields["products_id"]), 'cPath=' zen_get_generated_category_path_rev($random_featured_product->fields["master_categories_id"]) . '&products_id=' $random_featured_product->fields["products_id"]) . '">' zen_image(DIR_WS_IMAGES $random_featured_product->fields['products_image'], $random_featured_product->fields['products_name'], SMALL_IMAGE_WIDTHSMALL_IMAGE_HEIGHT); 
        
    $content .= '<br />' $random_featured_product->fields['products_name'] . '</a>';
        
    $content .= '<div>' $featured_box_price '</div>';
        
    $content .= '</div>';
        
    $random_featured_product->MoveNextRandom();
      }
    ?> 
    Best Sellers PHP
    PHP Code:
      $content '';
      
    $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent">' "\n";
      
    $content .= '<div class="wrapper"><table cellpadding=0 cellspacing=0 border=0>' .  "\n";
      for (
    $i=1$i<=sizeof($bestsellers_list); $i++) {
        
    $imgLink =  DIR_WS_IMAGES $bestsellers_list[$i]['image'];
        if (
    $i==2) {$content .= '<tr><td colspan=2><hr></td></tr>';}
        
    $content .= '<tr><td valign=top><a href="' zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' $bestsellers_list[$i]['id']) . '">' .     zen_image($imgLinkzen_trunc_string($bestsellers_list[$i]['name']), SMALL_IMAGE_WIDTH/2SMALL_IMAGE_HEIGHT/2) . '</a></td><td valign=top><a href="' zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' $bestsellers_list[$i]['id']) . '">' zen_trunc_string($bestsellers_list[$i]['name'], BEST_SELLERS_TRUNCATEBEST_SELLERS_TRUNCATE_MORE) . '</a><BR><div align=right>' zen_get_products_display_price($bestsellers_list[$i]['id']) . '</div></td></tr>' .     "\n";
      }

    if (
    BEST_SELLERS_TRUNCATE == '1') {
          
    $content .= '<br />' zen_draw_separator('pixel_silver.gif') . '<br />';
        }  
      
    $content .= '</table></div>' "\n";
      
    $content .= '</div>';

    ?> 

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Complicated Sidebox Question....where are the pros?

    You probably want to remove the table code and put it into div code.
    Code:
      $content = '';
      $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
      $content .= '<div class="wrapper"><table cellpadding=0 cellspacing=0 border=0>' .  "\n";
      for ($i=1; $i<=sizeof($bestsellers_list); $i++) {
        $imgLink =  DIR_WS_IMAGES . $bestsellers_list[$i]['image'];
        if ($i==2) {$content .= '<tr><td colspan=2><hr></td></tr>';}
        $content .= '<tr><td valign=top><a href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . zen_image($imgLink, zen_trunc_string($bestsellers_list[$i]['name']), SMALL_IMAGE_WIDTH/2, SMALL_IMAGE_HEIGHT/2) . '</a></td><td valign=top><a href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . zen_trunc_string($bestsellers_list[$i]['name'], BEST_SELLERS_TRUNCATE, BEST_SELLERS_TRUNCATE_MORE) . '</a><BR><div align=right>' . zen_get_products_display_price($bestsellers_list[$i]['id']) . '</div></td></tr>' .     "\n";
      }
    
    if (BEST_SELLERS_TRUNCATE == '1') {
          $content .= '<br />' . zen_draw_separator('pixel_silver.gif') . '<br />';
        }  
      $content .= '</table></div>' . "\n";
      $content .= '</div>';
    
    ?>
    then add div code like this
    Code:
      $content = '';
      $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
      
      for ($i=1; $i<=sizeof($bestsellers_list); $i++) {
        $imgLink =  DIR_WS_IMAGES . $bestsellers_list[$i]['image'];
        
        $content .= '<div class="bsItem"><a class="bsImage" href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . zen_image($imgLink, zen_trunc_string($bestsellers_list[$i]['name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) .
     '</a><a class="bsName" href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . zen_trunc_string($bestsellers_list[$i]['name'], BEST_SELLERS_TRUNCATE, BEST_SELLERS_TRUNCATE_MORE) .
     '</a><div class="bsPrice">' . zen_get_products_display_price($bestsellers_list[$i]['id']) . '</div></div>' .     "\n";
      }
    
    if (BEST_SELLERS_TRUNCATE == '1') {
          $content .= '<br />' . zen_draw_separator('pixel_silver.gif') . '<br />';
        }  
      
      $content .= '</div>';
    
    ?>
    Last edited by gjh42; 3 Nov 2010 at 08:11 PM.

  3. #3
    Join Date
    Sep 2010
    Posts
    612
    Plugin Contributions
    0

    Default Re: Complicated Sidebox Question....where are the pros?

    PERFECT! A few tweaks here and there and it's working like a charm. Thank you!

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Complicated Sidebox Question....where are the pros?

    Glad it's working! If there were any typos in the code posted, please post a corrected version - it's hard to debug long or complex statements in forum posts.

 

 

Similar Threads

  1. Upgrading to new version, quick question for the pros...
    By joyjoy in forum Upgrading from 1.3.x to 1.3.9
    Replies: 4
    Last Post: 15 Oct 2010, 10:10 AM
  2. complicated question not sure where to post
    By modwerx in forum General Questions
    Replies: 5
    Last Post: 16 Jul 2010, 03:47 PM
  3. Easy populate - quick question - where are the images defined??
    By Ben-B in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 11 Feb 2008, 03:13 AM
  4. Where Are the Linked PAges to the Record Companies Sidebox
    By mtrantas in forum Basic Configuration
    Replies: 3
    Last Post: 2 Feb 2008, 10:46 AM

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