Rank: Member
Joined: 1/10/2005(UTC) Posts: 714
Thanks: 14 times Was thanked: 1 time(s) in 1 post(s)
|
On my cateogry page, I would like show a details button instead of the add to cart button if a product has cross sells. I know how to show the details button and hide the add to cart button when there are product options, but not when there are cross sells. Is there a small snippet of code to achieve this?
Thanks!
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
You'd need to actually pull the list (or count) of cross-sells for each product before display to swap out the button.
|
|
|
|
Rank: Member
Joined: 1/10/2005(UTC) Posts: 714
Thanks: 14 times Was thanked: 1 time(s) in 1 post(s)
|
Ya I tried trying to learn how to do that with the little knowledge that I know I failed... BAD lol.
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
Here's a sudo-code summary:
1) Loop though each product (either when databinding or when rendering)
2) Check to see if the product has and choices or options
3) If the product has choices or options, display the "Details" button with a link to the product url, otherwise show the add to cart button.
All of the data should be present on the product. If not, you can call the function to pull the list of options/choices by product ID and get a count. If it's greater than zero, show details, otherwise show add to cart.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.