Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How to display all products that do not have a thumbnail

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #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
  #2  
Old 12-05-2005, 05:38 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Moving to Custom Mods...thanks for sharing
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 01-15-2007, 06:13 PM
  kcar's Avatar 
kcar kcar is offline
 

Member
  
Join Date: Jul 2004
Posts: 26
 

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

Works GREAT! Any chance you could modify this to show which products do not have a detail image. I suspect it's fairly simple but a I don't want to take a chance and screw it up.
__________________
x-cart gold
ver 4.1.9 Customized / XAOM
ver 4.1.19 / XAOM / XAFFIL
Reply With Quote
  #4  
Old 01-22-2007, 12:15 PM
 
Audiolines Audiolines is offline
 

Senior Member
  
Join Date: Mar 2006
Posts: 102
 

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

anyway to make the product code a link so it takes you directly to the product?
__________________
version 4.0.17
Reply With Quote
  #5  
Old 01-22-2007, 07:45 PM
  kcar's Avatar 
kcar kcar is offline
 

Member
  
Join Date: Jul 2004
Posts: 26
 

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

Quote:
Originally Posted by Audiolines
anyway to make the product code a link so it takes you directly to the product?

I'd really like that feature too but I am very happy with what I have so far.

I'd still like to see a version that shows which products don't have a detailed image associated with them.
__________________
x-cart gold
ver 4.1.9 Customized / XAOM
ver 4.1.19 / XAOM / XAFFIL
Reply With Quote
  #6  
Old 02-07-2007, 03:57 AM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

eXpert
  
Join Date: Aug 2003
Location: Carlisle, UK
Posts: 316
 

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

Updated coding so it works in latest v4.1.x branch ... Do everything it says but use the following as your prodwithoutimg.php file:
Code:
<?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_images_T ON xcart_products.productid = xcart_images_T.id WHERE xcart_images_T.id IS NULL"); $smarty->assign("productlisting",$productlisting); $smarty->assign("main","prodwithoutimg"); @include $xcart_dir."/modules/gold_display.php"; $smarty->display("provider/prodwithoutimg.tpl"); ?>

And if you want clickable links in your list ... use the following as your prodwithoutimg.tpl file:
Code:
{capture name=dialog} <table border=0> <TR> <TD height="10"><b>Product Number</b></TD> <TD height="10"><b>Product Name</b></TD> </TR> {section name=productlisting loop=$productlisting} <TR> <TD height="10"><a href="{$catalogs.provider}/product_modify.php?productid={$productlisting[productlisting].productid}&page=1">#{$productlisting[productlisting].productid}</a></TD> <TD height="10"><a href="{$catalogs.provider}/product_modify.php?productid={$productlisting[productlisting].productid}&page=1">{$productlisting[productlisting].product}</a></TD> </TR> {/section} </table> {/capture} {include file="dialog.tpl" title="Products Without Images" content=$smarty.capture.dialog extra="width=100%"}
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
Reply With Quote
  #7  
Old 11-11-2008, 08:32 PM
 
Brainary Brainary is offline
 

Advanced Member
  
Join Date: Nov 2007
Posts: 41
 

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

Hi, would you be able to tell me where I find the prodwithoutimg.tpl file:
and do I replace the whole file or just add the html to the file?
__________________
4.1.8
Reply With Quote
  #8  
Old 11-11-2008, 11:30 PM
  pauldodman's Avatar 
pauldodman pauldodman is online now
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,054
 

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

You have to create that file - it doesn't exist in x-cart.
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #9  
Old 04-27-2009, 05:51 PM
  AusNetIT's Avatar 
AusNetIT AusNetIT is offline
 

Senior Member
  
Join Date: Apr 2009
Posts: 152
 

Question Re: How to display all products that do not have a thumbnail

Quote:
Originally Posted by amy2203

Step 1 Add the following to common_templates.tpl:

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

Step 2 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%"}

Step 3 Upload prodwithoutimg.tpl to skin1/provider/

Step 4 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");
?>

step 5 Upload this file to provider/

Step 6 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.

Amy

HI Amy,

Done all but confuse with Step 6 just add following to provider/menu.tpl ?

<a href="{$catalogs.provider}/prodwithoutimg.php" </a>

Then where can i see it?
__________________
Melbourne website design | SEO in Melbourne

Installed Ver 4.6.0
Reply With Quote
  #10  
Old 04-30-2009, 09:45 PM
  AusNetIT's Avatar 
AusNetIT AusNetIT is offline
 

Senior Member
  
Join Date: Apr 2009
Posts: 152
 

Default Help Help

HI,

Can someone help please? Now i found how to do above

<a href="{$catalogs.provider}/prodwithoutimg.php" target="_blank"><b>Products Without Images</b></a>

But i got this error?

INVALID SQL: 1146 : Table 'netit_xcart.xcart_thumbnails' doesn't exist
SQL QUERY FAILURE: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


How do i search Images in Skin1\images folder?



Thanks,
__________________
Melbourne website design | SEO in Melbourne

Installed Ver 4.6.0
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:36 AM.

   

 
X-Cart forums © 2001-2020