• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

sternyy
#1 Posted : Thursday, October 27, 2011 2:08:04 PM(UTC)
sternyy

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!
Marcus
#2 Posted : Friday, October 28, 2011 9:34:55 AM(UTC)
Marcus

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.
sternyy
#3 Posted : Tuesday, November 1, 2011 12:31:48 PM(UTC)
sternyy

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.
Marcus
#4 Posted : Tuesday, November 1, 2011 1:14:38 PM(UTC)
Marcus

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.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012