Thread: Orders Sidebox

Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2012
    Posts
    345
    Plugin Contributions
    0

    Default Orders Sidebox

    Hello,
    I have side box which display recent orders in it. Right now it just display items name. How can I add item image to it. Order table does not have field product image. I tried to enter code few different way to pull from products table but it did not work. Can someone help me with the code to display item image in side box?

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    8,957
    Plugin Contributions
    309

    Default Re: Orders Sidebox

    Edit includes/templates/YOUR_TEMPLATE/sideboxes/tpl_order_history.php

    Remove the block of code between <li> and </li>

    In its place, put

    <a href="' . zen_href_link(zen_get_info_page($row['id']), 'products_id=' . $row['id']) . '">' . zen_get_products_image($row['id']) . '</a>

    so you have

    foreach ($customer_orders as $row) {
    $content .= '
    <li>
    <a href="' . zen_href_link(zen_get_info_page($row['id']), 'products_id=' . $row['id']) . '">' . zen_get_products_image($row['id']) . '</a>
    </li>
    ';
    }

    That will show the image instead of the name.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Jul 2012
    Posts
    345
    Plugin Contributions
    0

    Default Re: Orders Sidebox

    Its not tpl_order_history.php side box. Its recent/latest orders side box which shows random recent orders from different customers.

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    8,957
    Plugin Contributions
    309

    Default Re: Orders Sidebox

    This must be a plugin then. At any rate, the code block you will want will be similar to what I posted.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Jul 2012
    Posts
    345
    Plugin Contributions
    0

    Default Re: Orders Sidebox

    Quote Originally Posted by swguy View Post
    This must be a plugin then. At any rate, the code block you will want will be similar to what I posted.
    Yes it is. It shows orders in side box like mentioned at following link
    https://www.zen-cart.com/showthread....age-in-sidebox

    I tried code you provided it did not work. The code I have in that file right now is

    HTML Code:
    $content = '';$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';if(sizeof($latestOrdersArray) > 0) {  $content .= '<ul>';  foreach ($latestOrdersArray as $order) {    $content .= '<li><div class="order-item">';    $content .= '<div class="order-item-details">';        //    $content .= sprintf(LATEST_ORDERS_SIDEBOX_HAS_BOUGHT1, '<strong>' . $order['name1'] . '</strong>', '<strong>' . $order['country1'] . '</strong>');
    
    $content .= '<br/>';
    
    
    
        $first = true;    foreach($order['products'] as $product) {      if($first === false) {        $content .= '<br/> ';      }                  $content .= '<a href="' . zen_href_link('product_info', 'products_id=' . $product['id']) . '">' . $product['name'] .            '</a><br/>';           
                $first = false;    }        
                '</a><hr/>';

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    8,957
    Plugin Contributions
    309

    Default Re: Orders Sidebox

    Did you change $row to $product in each place it was used? Because your for loop uses a different value than the one from the built-in sidebox.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  7. #7
    Join Date
    Jul 2012
    Posts
    345
    Plugin Contributions
    0

    Default Re: Orders Sidebox

    Quote Originally Posted by swguy View Post
    Did you change $row to $product in each place it was used? Because your for loop uses a different value than the one from the built-in sidebox.
    Thank you! It working now but if order has more than one product then those products don't appear nice layout. Its auto scroll vertical one item appear at a time if order has only 1 item but if its more than 1 item they all appear scattered. Any idea how to fix this?

 

 

Similar Threads

  1. Help: Remove New Orders sidebox from Admin Profiles
    By jewelsexports in forum Basic Configuration
    Replies: 1
    Last Post: 16 Sep 2011, 06:43 AM
  2. Edit Orders + Super Orders + Create Customer +Create Orders
    By laurenjj in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 27 May 2011, 07:10 PM
  3. How to dispaly the latest orders on homepage in sidebox?
    By qimaoya in forum Basic Configuration
    Replies: 2
    Last Post: 21 Nov 2010, 10:25 PM
  4. Paypal IPN new orders not showing on Customers/Orders page
    By daelan in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 1 Feb 2010, 02:23 AM
  5. Change Admin orders.php page to show early orders first
    By TJB in forum Managing Customers and Orders
    Replies: 1
    Last Post: 15 Nov 2008, 02:49 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