![]() |
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 |
Moving to Custom Mods...thanks for sharing :)
|
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.
|
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?
|
Re: How to display all products that do not have a thumbnail
Quote:
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. |
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 And if you want clickable links in your list ... use the following as your prodwithoutimg.tpl file: Code:
{capture name=dialog} |
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? |
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.
|
Re: How to display all products that do not have a thumbnail
Quote:
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? :-) |
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, |
All times are GMT -8. The time now is 12:32 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.