Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,839
    Plugin Contributions
    31

    Default View a product/category in the catalog from a link in admin product/category listing

    I wanted an quick way to get to the catalog page of the category or product I was editing in the Admin, so this is what I did...this may be of interest to others

    Both edits are in admin/includes/modules/category_product_listing.php

    1) Category Link
    In the admin category listing I made the category title a link to the shop category:
    line 24
    from
    PHP Code:
    <td class="pageHeading"><?php echo HEADING_TITLE?>&nbsp;-&nbsp;<?php echo zen_output_generated_category_path($current_category_id); ?></td>
    to
    PHP Code:
    td class="pageHeading"><?php echo HEADING_TITLE?>&nbsp;-&nbsp;<?php //ORIGINAL echo zen_output_generated_category_path($current_category_id); 
                
    echo '<a href="' zen_catalog_href_link('index'zen_get_path($current_category_id)) . '" target="_blank" title="View in shop">' zen_output_generated_category_path($current_category_id) . '</a>'?>
                </td>
    and a bit of extra css to make it look consistent:
    h1,.pageHeading, .pageHeading a{
    color:#003D00; /*727272*/
    font-size:16px;
    font-variant:small-caps;
    font-weight:bold;
    }
    2) Product Link
    In admin product listing I made the product id a link for me to drag and drop which opens a new window in my browser configuration. I found that having the link open a new window with "_blank" would work but the admin product-edit page would open too, maybe someone knows how to stop the jscript row select from firing in this case.

    line 328
    from
    PHP Code:
    <td class="dataTableContent" width="20" align="right"><?php echo $products->fields['products_id']; ?></td>
    to
    PHP Code:
    <td class="dataTableContent" align="right" valign="middle"><?php //original echo $products->fields['products_id']; 
                    
    echo '<a href="' zen_catalog_href_link('product_info','cPath='.zen_get_product_path($products->fields['products_id']).'&amp;products_id='.$products->fields['products_id']) . '" title="View in shop">' .  $products->fields['products_id'] . '</a>'?></td>
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: View a product/category in the catalog from a link in admin product/category lis

    I have not tested this, but peeking at the Products Price Manager for the View Details, I grabbed this and added the products_id that I think you need:
    Code:
    '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . zen_get_product_path($products->fields['products_id']) . '&pID=' . $products->fields['products_id'] . '&product_type=' . zen_get_products_type($products->fields['products_id'])) . '">'
    See if that helps you out ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,839
    Plugin Contributions
    31

    Default Re: View a product/category in the catalog from a link in admin product/category lis

    See if that helps you out ..
    Thanks but, that link construct goes to the admin category page for that product whereas I am talking about a link from the admin poruct listing to that product info page in the catalog. The example I posted works...just 2) does not open a new tab/window automatically.
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: View a product/category in the catalog from a link in admin product/category lis

    On the TR take out the mouse over ...

    I just comment out the two TR and beneath the IF put in:
    Code:
            echo '<tr class="dataTableRow" >';
    Then on the TD put in:
    Code:
                    <td class="dataTableContent" width="20" align="right"><?php echo '<a href="' . zen_catalog_href_link('product_info', 'cPath=' . zen_get_product_path($products->fields['products_id']) . '&amp;products_id=' . $products->fields['products_id']) . '" title="View in shop" target="_blank">' . $products->fields['products_id'] . '</a>'; ?></td>
    You lose the mouse over but your still have the E for EDIT and now you don't get the Preview when you click the link ...

    If you want the mouse over, add another icon for Preview instead of using the products_id ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,839
    Plugin Contributions
    31

    Default Re: View a product/category in the catalog from a link in admin product/category lis

    I decided to keep the highlighting but remove the mouseover href as it is a bit pointless really, the number of times I've gone into Edit when I wanted to enable/disable....
    Thanks
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

 

 

Similar Threads

  1. v151 Making each product listing on the Category pages a link
    By GodfatherAntiques in forum Templates, Stylesheets, Page Layout
    Replies: 20
    Last Post: 16 Mar 2013, 03:45 AM
  2. Category/product listing not showing in the admin panel
    By mottaguedes in forum Basic Configuration
    Replies: 1
    Last Post: 24 Mar 2011, 06:02 PM
  3. One product in category view - can I skip single product category listings?
    By ImageNation in forum Customization from the Admin
    Replies: 5
    Last Post: 29 Sep 2008, 03:32 PM
  4. Link to first product in category, NOT listing
    By thomasharding in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 27 May 2008, 02:57 PM
  5. Category/Product Listing Mix/Hybrid View
    By metroman in forum Templates, Stylesheets, Page Layout
    Replies: 13
    Last Post: 15 Nov 2006, 04:36 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