View Single Post
  #1  
Old 11-22-2005, 04:28 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default How to display all products that do not have a thumbnail

As I'm always here asking questions, I thought I would offer what I can, I added this code to my version of xcart 3.5.10 so I can see what products need a thumbail. This page lists them all in one big list, and links the product number to the product_modify page for that product.

I cannot guarantee the safety of this mod, all I know is it works for me, on my system.

Add the following to common_templates.tpl:

{elseif $main eq "prodwithoutimg"}
{include file="provider/prodwithoutimg.tpl"}

create a file called prodwithoutimg.tpl containing:

{capture name=dialog}
<table border=0>
<TR>
<TD height="10">Product Number</TD>
<TD height="10">Product Name</TD>
</TR>

{section name=productlisting loop=$productlisting}
<TR>
<TD height="10">{$productlisting[productlisting].productid}</TD>
<TD height="10">{$productlisting[productlisting].product}</TD>
</TR>

{/section}
</table>
{/capture}
{include file="dialog.tpl" title="Products Without Images" content=$smarty.capture.dialog extra="width=100%"}

Upload prodwithoutimg.tpl to skin1/provider/

create a file called prodwithoutimg.php containing:

<?php

require "./auth.php";
require $xcart_dir."/include/security.php";

$productlisting = func_query("SELECT xcart_products.productid, xcart_products.product FROM xcart_products LEFT OUTER JOIN xcart_thumbnails ON xcart_products.productid = xcart_thumbnails.productid WHERE xcart_thumbnails.productid IS NULL");


$smarty->assign("productlisting",$productlisting);
$smarty->assign("main","prodwithoutimg");


@include $xcart_dir."/modules/gold_display.php";
$smarty->display("provider/prodwithoutimg.tpl");
?>

Upload this file to provider/

create a link to provider/prodwithoutimg.php somewhere to access the page, I have it in my provider/menu.tpl file:

Products Without Images


so it appears in the products menu when I log in.

hth

Amy
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote