Hello all,
I'm trying to display a paginated product catalog. The catalog itself
will only display the product image and name. When you click on the
image/name, you will be taken to the product page.
Each product is available in a number of sizes/fragrances, but I want
the product to appear only once in the catalog (and the available
sizes/fragrances to appear in the product page itself).
However, I'm facing a problem trying to set the result set to
"distinct" based on the product name (for the catalog). I can't seem
to set the select columns for the sfPropelPager. I tried the following
code:
$c = new Criteria();
$pager = new sfPropelPager('Product', 5);
// specifying the select columns
$c->addSelectColumn(ProductI18nPeer::NAME);
$c->setDistinct();
$pager->setCriteria($c);
$pager->setPage($this->getRequestParameter('page', 1));
$pager->init();
$this->pager = $pager;
But this gives me the error: "Error populating Product object
[wrapped: Invalid resultset column: 2]"
Is there a way I can get the distinct to work with the sfPropelPager?
Or do you guys recommend a different approach to this issue?
Your help is highly appreciated, and please let me know if you require
any more information regarding this problem.
Thanks in advance :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---