| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Adding "More Colors" to products_t.tpl listing | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() I've checked through this forum back to 1/2011 and I haven't seen anything addressing this (or I've missed it).
I'd like to add "More Colors" to the products_t.tpl listing if there is more than one color option for any given product so customers know while browsing that there are more colors available. Has anybody done this or does anybody know of a module that will? I've tried to code it myself but... epic fail. Thanks in advance! Ana
__________________
"Real knowledge is to know the extent of one's ignorance."-- Confucius X-Cart 4.4.4 MySQL 5.0.92 Apache/2.0.64 (Unix) PHP 5.3.6 CentOS 5.5 MODS: Template Mela- Theme XCT010002 Altered Cart- CheckoutOne BCS Engineering- Back In Stock Notification X-Cart Mods- Thumbnail Candy X-Cart Mods-Advanced Shop Closed Google Site Search |
|||||||||
#2
|
|||||||||
|
|||||||||
![]() What you are talking about are referred to as "product options" and the way x-cart handles these are if the customer clicks the "add to cart" button in either "featured products" or the "category" page they will be re-directed to the "product" page where they can choose the option.
In order to allow the customer to choose the option(s) on the "featured products" or the "category" page the code from product_details.tpl would need to be added to featured.tpl, and products.tpl or products_t.tpl.
__________________
Two Separate X-Cart Stores Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series. Integrated with Stone Edge Order Manager + POS Version 4.1.12 Gold (fresh install) - X-AOM - Linux Mods - XCSEO free |
|||||||||
#3
|
|||||||||
|
|||||||||
![]() No, I want the words "More Colors" to appear on the product listing page so the customer knows the product is available in more colors while browsing the product list. So if the product has the product option of "Color" and there is more than one choice for that option, the words "More colors" appear on the products_t list with the product "as info".
I'm all too familiar with the options and variants of x-cart after working with it for 7 years. I think they are the reason for some of my silver hair. LOL Ana
__________________
"Real knowledge is to know the extent of one's ignorance."-- Confucius X-Cart 4.4.4 MySQL 5.0.92 Apache/2.0.64 (Unix) PHP 5.3.6 CentOS 5.5 MODS: Template Mela- Theme XCT010002 Altered Cart- CheckoutOne BCS Engineering- Back In Stock Notification X-Cart Mods- Thumbnail Candy X-Cart Mods-Advanced Shop Closed Google Site Search |
|||||||||
#4
|
|||||||||
|
|||||||||
![]() If "more colors" is the only product option you have (i.e. no "size", "length", etc.) then it should be a simple matter of checking if the product has options in your products_tpl and displaying a "more colors" text or text variable.
Something like adding.. {if $active_modules.Product_Options ne ""}"More Colors"{/if} to your products_t.tpl might work. Otherwise, just follow how product options are displayed on the product.tpl and product_details.tpl to find where it is determined where a product has options or not and add that to your products_t.tpl in the appropriate place with the appropriate text.
__________________
Two Separate X-Cart Stores Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series. Integrated with Stone Edge Order Manager + POS Version 4.1.12 Gold (fresh install) - X-AOM - Linux Mods - XCSEO free |
|||||||||
#5
|
|||||||||
|
|||||||||
![]() Actually, we do have sizes as well but I see what you are getting at. All of our products have at least one color option so it would have to be any product who's color option values are greater than 1.
Basically if the product $v.class = color and it's classid.optionid value > 1 then display "more colors". My problem is getting the coding correct. I'm not a wizbang at it ![]() Ana
__________________
"Real knowledge is to know the extent of one's ignorance."-- Confucius X-Cart 4.4.4 MySQL 5.0.92 Apache/2.0.64 (Unix) PHP 5.3.6 CentOS 5.5 MODS: Template Mela- Theme XCT010002 Altered Cart- CheckoutOne BCS Engineering- Back In Stock Notification X-Cart Mods- Thumbnail Candy X-Cart Mods-Advanced Shop Closed Google Site Search |
|||||||||
#6
|
|||||||||
|
|||||||||
![]() I don't think detailed option data is available on product listings pages. You need to customize the php to go get all of the option data for the products on that page. I believe there are other threads that have code to help get that data.
|
|||||||||
#7
|
|||||||||
|
|||||||||
![]() I'm not looking for detailed options on the product listing page. I just want the words "more colors" to appear on the product listing page beneath the image if the product has more than one color option available.
Ana
__________________
"Real knowledge is to know the extent of one's ignorance."-- Confucius X-Cart 4.4.4 MySQL 5.0.92 Apache/2.0.64 (Unix) PHP 5.3.6 CentOS 5.5 MODS: Template Mela- Theme XCT010002 Altered Cart- CheckoutOne BCS Engineering- Back In Stock Notification X-Cart Mods- Thumbnail Candy X-Cart Mods-Advanced Shop Closed Google Site Search |
|||||||||
#8
|
|||||||||
|
|||||||||
![]() You still need to query the db, products options is not available on products list page. Try this
In include/search.php find PHP Code:
and just before add (replace 'Color' with your option class name exactly as you have it) PHP Code:
then in the products list template where you want it to show Code:
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#9
|
|||||||||
|
|||||||||
![]() Quote:
You always seem to understand what I'm getting at, Steve! LOL! Thanks so much. I had to do a little modification on it as all our products have at least one color so they will all have the class "Color", however, if there is more than one color the classtext is "Select Color" instead of "Color". Changed it to the classtext version and voila. Steve, YOU ROCK! Ana
__________________
"Real knowledge is to know the extent of one's ignorance."-- Confucius X-Cart 4.4.4 MySQL 5.0.92 Apache/2.0.64 (Unix) PHP 5.3.6 CentOS 5.5 MODS: Template Mela- Theme XCT010002 Altered Cart- CheckoutOne BCS Engineering- Back In Stock Notification X-Cart Mods- Thumbnail Candy X-Cart Mods-Advanced Shop Closed Google Site Search |
|||||||||
#10
|
|||||||||
|
|||||||||
![]() No problem, glad you got it working
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
|||
X-Cart forums © 2001-2020
|