WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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. – Stephen Nov 3 '12 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 Nov 3 '12 at 1:31
Ok so now the reasoning makes sense. Unfortunately the scenario stumps me as far as a simple solution. – Stephen Nov 3 '12 at 1:54

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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