X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   How to display all products that do not have a thumbnail (https://forum.x-cart.com/showthread.php?t=18136)

amy2203 11-22-2005 04:28 AM

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

balinor 12-05-2005 05:38 AM

Moving to Custom Mods...thanks for sharing :)

kcar 01-15-2007 06:13 PM

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.

Audiolines 01-22-2007 12:15 PM

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?

kcar 01-22-2007 07:45 PM

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.

carlisleglass 02-07-2007 03:57 AM

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


Brainary 11-11-2008 08:32 PM

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?

pauldodman 11-11-2008 11:30 PM

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.

AusNetIT 04-27-2009 05:51 PM

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? :-)

AusNetIT 04-30-2009 09:45 PM

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,

amy2203 06-06-2009 01:20 AM

Re: How to display all products that do not have a thumbnail
 
you'll need to change the query in the prodwithoutimg.php file, try something like this,

Code:

SELECT netit_xcart_products.productid, netit_xcart_products.product FROM netit_xcart_products LEFT OUTER JOIN netit_xcart_thumbnails ON netit_xcart_products.productid = netit_xcart_thumbnails.productid WHERE netit_xcart_thumbnails.productid IS NULL

assuming your database uses netit_ as a prefix to it's tables. Otheriwse, check what your thumbnails table is called,

amy2203 06-06-2009 01:30 AM

Re: How to display all products that do not have a thumbnail
 
The query needed for 4.1 is probably
Code:

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
ORDER BY add_date DESC


looks like xcart_thumbnails is an old table no longer used,

AusNetIT 06-08-2009 03:10 AM

Re: How to display all products that do not have a thumbnail
 
HI Amy,

All my images are in xcart\images folder so i think we need to create different query to achive this isn't it?

Thanks.

amy2203 06-08-2009 03:13 AM

Re: How to display all products that do not have a thumbnail
 
they will still need to be referenced in the database,

royng 06-25-2009 11:00 AM

Re: How to display all products that do not have a thumbnail
 
I am a newbie. I am really lost, Can someone tell me which file need to be modify and what need to be create? Plus location of the files too. Thanks!

royng 06-25-2009 11:04 AM

Re: How to display all products that do not have a thumbnail
 
Carlisleglass, I like your site. How did you add the view all option to your product's page? Is that alot of work? Please let's me know the step by step. Thanks!


All times are GMT -8. The time now is 03:06 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.