Forums / General Questions / Suggest a product category if it's not in the cart?

Suggest a product category if it's not in the cart?

Locked

Started by cosmocanuck on 29 May 2008, 5:52 PM · Views: 1,990

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
29 May 2008, 5:52 PM
#1
cosmocanuck avatar

cosmocanuck

New Zenner

Join Date:
Jun 2006
Posts:
85
Plugin Contributions:
0

Suggest a product category if it's not in the cart?

Hi! I would like, on viewing the cart, to have a message suggesting a particular type of product (in this case, a greeting card) to go with your purchase. But - here's the kicker - only if you haven't already got a greeting card in your cart already!

I've used the Better Together plugin to offer discounts when buying two products together, but in this case there's no discount - I just want to suggest that people add the other item.

Is there some PHP I could use on the cart page that could in effect say, "If no items currently in the cart are from Category 6, print this message: 'Why not add a greeting card to your order?' "

Does that make sense? Is it possible and/or (dare I hope) easy?

Thanks!
Adam

29 May 2008, 8:05 PM
#2
nev avatar

nev

New Zenner

Join Date:
Nov 2007
Location:
Canada
Posts:
49
Plugin Contributions:
0

Re: Suggest a product category if it's not in the cart?

Hay Adam,
The answer is kinda, sorta but not really.

There is a great contribution called Cart Upsell / Cross sell that will extend the Cross Sell contribution to the shopping cart and show items from the cross sell selection of the items in the cart. Don’t worry about the version number of it. It works just fine with my 1.3.8 cart install.

http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=283

However, it’s not exactly what you want. It’s the closest thing to it available. It will set up the cross sell for products not categories. So if you associate Card 1 to Product 1 and Card 2 to Product 2 (seems like you don’t care what card just that its one of them) if a customer Buys Product 1 and no cards it will suggest a card in this case Card 1. However if they buy Product 1 and any other card except Card 1 it will still suggest Card 1.

So as stated, kinda, sorta but not really. If you are comfortable with php you might be able to adjust the code. Extend the code so that when checking the product ID in cart for inclusion of cross sell items it also checks for the category number and if category number for products in cross sell match any product category ID already in the cart then do not display cross sell.

It would still only show (a) particular card(s) in the cross sell and not a category. If you have the exclusion going you can load multiple Cards as cross sells to each products so more than one shows.

It’s not exactly what you are looking for but it might be a starting point.

So as for possible Yes. as for easy that depends on your php skils.

nev

29 May 2008, 11:57 PM
#3
cosmocanuck avatar

cosmocanuck

New Zenner

Join Date:
Jun 2006
Posts:
85
Plugin Contributions:
0

Re: Suggest a product category if it's not in the cart?

Thanks for the summary! You're right though, it's not quite what I was hoping for. And my PHP skills are still pretty rudimentary.

I'll just add a "boilerplate" text message suggesting that shoppers add a card, and won't worry about whether or not they have one already in their cart. For now, at least.

Thanks though!
adam