Jump to content

Free Product automatically added to cart


Recommended Posts

Hi,

Is there a way I can automatically include a free product to the customers cart with a 0 value when the customer purchases more than a certain total or products, much like the free shipping option?

I would like to include promotional items to the users cart if they meet the minimum order requirements?

Link to comment
Share on other sites

In theory it seems to be straighforward, but i'm not convinced it's as easy as it sounds!

You can use the "cart" hook to provide additional processing each time the Cart:add() and Cart::update() functions are called, so in theory you could work out whether the customer cart qualifies for the free item, but I see two potential issues (that likely won't be answered until someone tries it!):

#1 From a brief look at the code I'm not convinced that either of these functions is always called when the actual value of the cart changes. This hook may, in itself, not be sufficiently reliable to make the add/remove free product decision.

#2 The free product would need to be handled in a special way to a) indentify it and B) prevent people adding it manually. B) could be handled by having it as a regular product available for purchase at a price if the cart contents don't qualify getting it for free. a) would then simply be a case of providing a method of specifying the free product in the module configuration screen.

Paul

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...