View Single Post
  #9  
Old 06-21-2012, 12:31 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Product options in product list

Quote:
Originally Posted by xcellere
I have the same problem as the OP. How do I load that array?
After reading back through this thread, I realized that I never understood what the thread was really about. You guys are trying to display the options on the product list, for instance on category pages. I was showing you code that should work on the product page itself. Sorry. Just going too fast, I need to slow down.

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.
Reply With Quote