0

The question is: How can I change/set the product price to 0 for every product whenever a product added to the cart. There is a hook in the plugin as wpsc_set_cart_item so I can call it but can't figure out how to change the price on the fly and return the new parameters.

Hope someone can help me. Please ask anything you need to know. Thanks.

3
  • Is there some reason that you can't simply set the product price to 0? That way the customer clearly sees the price of the product. Generally speaking what you're asking to do is called 'bait and switch'; although not in the normal 'charge a higher price' way. Unless you have very specific and legitimate reasons to do this I'd shy away from this approach.
    – Steve
    Commented Nov 3, 2012 at 1:28
  • @Stephen, Actually I want to show the monthly charge as the product price and during the purchase I need to sell the product without any cost, it's for cell phones.
    – The Alpha
    Commented Nov 3, 2012 at 1:31
  • Ok so now the reasoning makes sense. Unfortunately the scenario stumps me as far as a simple solution.
    – Steve
    Commented Nov 3, 2012 at 1:54

1 Answer 1

1

If you're not actually selling the phone without the service contract I'd suggest simply putting the phone cost in to a product meta field and displaying it on the product page. This would keep things in the normal purchase flow.

A second option, again if you're not actually selling the phone, would be to have the phone as variation with 0 stock and don't allow back orders. That way the customer couldn't purchase the phone. Of course you'd have to list the service contract as a separate variation.

If you are selling the phone itself you could simply put the phone and the service plan as different variations and control the price that way.

Other than that you'd have to find the right WP e-commerce hook and do a bit of coding.

Hope that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.