| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Product options in product list | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Product options in product list
Hi, is there a change to add product option (price modifier etc...) to show in products list? For example under {$product.descr}? Thanks for advance!
__________________
4.1.11 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Product options in product list
I haven't tested this yet, but it should work fine to display the options. Written for 4.4.5, you may need to modify it for your version. I also assumed you would be placing it within a table, you may need to adjust or remove the row and column tags.
PHP Code:
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#3
|
|||||||
|
|||||||
Re: Product options in product list
Thanks a lot for the quick answer! Well, it just displays the titel "Product Options" not the options itself. Do You have a hint, what would be wrong?
__________________
4.1.11 |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Product options in product list
Tom, I just tested it on my test site: http://trainingpen.com/Acer-TravelMate-212T.html it is working just as I expected it to. I would try and look at the variables in webmaster mode, and see if they are set or not.
Product option variables may have different names or arrangement in your version. I am using 4.4.5. When you fire up webmaster mode, click the button that shows the variables instead of template names. Then check the variable names. Do you have an array named $product_options? Use control-F to search the debug console window.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#5
|
|||||||
|
|||||||
Re: Product options in product list
In my version there is not possible to show variables instead of template names I guess. But yes, the array named $product options is present
__________________
4.1.11 |
|||||||
#6
|
|||||||||
|
|||||||||
Re: Product options in product list
It is probably possible for you to see the variables, but you need to apply a patch, or set the debug mode in config.php (I think)
Look at this thread: http://forum.x-cart.com/showthread.php?t=44543&highlight=debug You can also choose to print the entire array with the smarty command: {$product_options|@print_r} Then you can see the variables that you need to access, and figure out why the code isn't working. Your version must refer to the options differently. I suspect it might not have the classtext part, maybe it is optiontext or something else in 4.1.11.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#7
|
|||||||
|
|||||||
Re: Product options in product list
Hi,
Does anyone have any ideas on how to add product variants to the product list page. I'm having a look at the customer_options.php page but can't seem to find how to make sure its added on the product list page.
__________________
Version 4.4.2 |
|||||||
#8
|
|||||||
|
|||||||
Re: Product options in product list
I have the same problem as the OP. When I add the code, the title is all that shows, just no drop down. I did check the variables and $product_options isn't there. How do I load that array?
__________________
Sunthing Productions Version 4.5 |
|||||||
#9
|
|||||||||
|
|||||||||
Re: Product options in product list
Quote:
You can load the array yourself in php, but you need to determine where the values are pulled from, and access them in the DB. I don't have a quick answer for you unfortunately, I have no idea how product options are handled in 4.1.X But lets start figuring it out! First lets see how the product options are pulled on the product page. We already have a clue from SamuraiCoder: customer_options.php. Do you have that file in 4.1.X? I think we can assume it is referenced in product.php. So when we pull up the product page, we are really accessing product.php, and then in turn it is including or requiring customer_options.php. My first step would be to verify that the assumptions I have made above are true, by looking through product.php. Then if so, I would pull open customer_options.php and take a look at how the options were being accessed. Armed with that knowledge we can start determining where we need to add code to pull these options on the page in question. I believe that the products list is generated by search.php. The actual page we are on when looking at a category is home.php?cat=(somenumber). When ?cat= is included it sets a variable $cat, and the value which is the categoryid. If this is the case it includes search.php (I think) and the database is queried for the products in that category. Our mission is to understand the inner workings of that query, and add the lines that we found in customer_options.php or some variation of those lines. What we are trying to do is pull the product option values for each product found, and assign them to the $products array. Sorry for the long post, just trying to make sure even a noob could understand. Hopefully that helps.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
#10
|
|||||||
|
|||||||
Re: Product options in product list
Thank you for such a detailed post Mike. I should note that I just updated my signature to show my current version: 4.5. No longer 4.1.
EDIT: This is the code in customer_options.tpl: Code:
__________________
Sunthing Productions Version 4.5 |
|||||||
|
|||
X-Cart forums © 2001-2020
|