| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
How do I remove the 'defalult_image'? | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Some of my products have images and some don't.
What I'm out to do is to only display the images when there is one, but when there isn't one I only want to display the text link without the 'default_image' taking up space. I would of thought that you could turn this on/off in the config. any ideas?
__________________
xcart v3.5.8 through to v4.0.14 redhat v9 php v4.3.10 MySQL 4.0.22 |
|||||||
#2
|
|||||||
|
|||||||
![]() I've found a work around. I replaced the default_image.gif with a transparent gif only 1px high
__________________
xcart v3.5.8 through to v4.0.14 redhat v9 php v4.3.10 MySQL 4.0.22 |
|||||||
#3
|
|||||||
|
|||||||
![]() You should use an if/else statement for whether there is a product thumbnail or not. It should either reflect another image (like your transparent one) or ...
- Mike
__________________
4.1.9 |
|||||||
#4
|
|||||||
|
|||||||
![]() I agree. And that's what I set out to do. I ended up at:
x-cart-directory/image.php I tried commenting out the following line of code from the file where ever it was called (a bit rough I know) as all of the thumbnails for the products are held in the database. But it had no effect... not sure why... it's something that I'm planning on chasing up and testing further when I find time. Code:
__________________
xcart v3.5.8 through to v4.0.14 redhat v9 php v4.3.10 MySQL 4.0.22 |
|||||||
#5
|
|||||||
|
|||||||
![]() I have 2 different answers to solve this issue. The first is the easy way with minimum configuration and little control, and the second is the long way so you can have full control over every category image displayed.
The easy way: 1) Add a record to the table "xcart_config" as follows: Code:
2) Modify the file "skin1/customer/main/subcategories.tpl" Around line 17, find the line: Code:
and change it to: Code:
That's all... If you want to change the way the category images are displayed just go to the Administration area and select the General settings / Appearance options and select or deselect the option to Show category image (it should be at the bottom of the page). With this option selected, all category images will be shown and with it deselected, all category images will not be shown. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Now, the long way: 1) Add a new field show_image to the table xcart_categories: Code:
Note: If you want the default option to always start with "No" instead of "Yes" to display category images, then just execute the code below instead: Code:
2) Add a new label lbl_show_image in the Language area: Go to the Language option and select the language you want to edit. Make sure the Select topic is on the Labels option. Now, go down towards the bottom of the page and add a new label entry. Code:
3) Then change the following 3 files: -skin1/customer/main/subcategories.tpl -skin1/admin/main/category_modify.tpl -admin/category_modify.php In the file skin1/customer/main/subcategories.tpl around line 17 change: Code:
to Code:
In the file skin1/admin/main/category_modify.tpl around line 72 find the following code: Code:
and insert this code right after it: Code:
Note: If you want the default option on the add new category screen to always start with "No" instead of "Yes" to display category images, then just insert the code below instead: Code:
In the file admin/category_modify.php around line 135 change: Code:
to Code:
That's it..... Now you can have full control over what category icons are displayed. When you go the modify category option there will now be an option for Show image towards the top of the screen, where you can select to allow to display or not display this specific image for this category. If you have any suggestions, please let me know....
__________________
X-Cart Gold: v4.0.17 |
|||||||
#6
|
|||||||
|
|||||||
![]() I will be posting the product image code soon....
__________________
X-Cart Gold: v4.0.17 |
|||||||
#7
|
|||||||
|
|||||||
![]() I finally got the code straight for the product default image. I ran into a few issues wih variable scoping.
Anyway... As I re-did the product code, I also re-did an option for the category code. The following code changes will allow you to show or not show the default icon image for categories or products. This includes the featured item list, bestsellers etc. I also coded this change to only affect the customer areas, as I usually want to see what is going on into the admin area. 1) Add the following 2 records in the xcart_config table: Code:
2) Change the file skin1/product_thumbnail.tpl: from: Code:
to: Code:
3) Change the file skin1/customer/main/subcategories.tpl around line 17: from: Code:
to: Code:
4) Then add the following code to the end of the file include/func.php: Code:
and Code:
That's all... If you want to change the way the product/category images are displayed just go to the Administration area and select the General settings / Appearance options and select or deselect the options to Show default category image and Show default product image (they should be at the bottom of the page). This modification will not remove the added space taken up by the image if it were displayed. If you want to do this, then you will need to change about 15 other files. Typically, you just need to look for references to the text product_thumbnail.tpl in all of the files and put the following code around where the display table is built to display the image and remove the modification to the file skin1/product_thumbnail.tpl Code:
Let me know if this works for you....
__________________
X-Cart Gold: v4.0.17 |
|||||||
#8
|
|||||||
|
|||||||
![]() Very nice mod. I'm using it on a site I'm putting together right now. I had a problem when trying to use the last part of the code:
Quote:
When I use the insert name and {if} statement outside of the skin1/product_thumbnail.tpl file, it's not working properly and removes thumbnail images from all products, not just those with the default image. Here is code I use in product.tpl and products.tpl for my thumbnails: Code:
That code creates a border around the thumbnails. You can view the following link to see it in action http://www.ezcruiseconnection.com/home.php?cat=9 although when you view it, I'll probably have the "see details" link inside of the border tables. That seems to be the only way I can remove the default images but still have something inside of the tables that don't go away, as seen here http://www.ezcruiseconnection.com/home.php?cat=14. Other than that - it's very nice and thanks a million for the time you donated to it.
__________________
~zilker uummm...perhaps you should tell me again. http://www.designertrends.com Version 4.0.6 Unix |
|||||||
#9
|
|||||||
|
|||||||
![]() Well, I fixed it with some bubble gum and duct tape
![]() Here's what I did. I took the tables that created the image border and inserted them into the product_thumbnail.tpl file. Then, I realized that the tables sat in between the url tags that made the image clickable. Since that didn't work out as planned, I was forced to think some more which resulted in another idea. I had to put the url tags inside the tables that I placed in product_thumbnail.tpl. Since products.tpl and product.tpl both read from the same file and call different variables, the modified code wouldn't pull the image on the product.tpl page. So, I created a new file named product_thumbnail_products.tpl and changed products.tpl to include that new file instead of the original. Here's what we're looking at: /product_thumbnail_products.tpl Code:
/product_thumbnail.tpl Code:
customer/main/products.tpl - only a portion of the file Code:
I also moved the "See details" link and placed it under the short description. That prevents it from being out of place when there isn't a default image. Like I said, it probably isn't the best way to do it but it works. I haven't tested it in the checkout process but it shouldn't be that difficult to make a small change if something isn't right.
__________________
~zilker uummm...perhaps you should tell me again. http://www.designertrends.com Version 4.0.6 Unix |
|||||||
#10
|
|||||||
|
|||||||
![]() Quote:
Worked great in 4.013 Pro Thanks!
__________________
--- RBasil X-Cart 4.0.13 Pro |
|||||||
|
|||
X-Cart forums © 2001-2020
|