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

I want to programmatically add an item to the cart, and that item is not a product.. It's a custom post type that I am creating. I think I'm going in the right direction by using the Jigoshop cart class. Found in the jigoshop folder under classes/jigoshop_cart.class.php. The problem is that I'm not sure exactly how to hook something into it that is not a product.. I thought maybe someone could point me the right direction.

Thanks in advance!

share|improve this question
Are you trying to sell access to premium content? The logic and goal escape me. – Stephen Feb 4 '13 at 18:18
Is there another way around what I'm trying to do, yes.. However that's not very elegant and I want to accomplish it this way. Thanks. – willbeeler Feb 7 '13 at 0:48
You didn't answer my question, nor is your OP very clear. So there's little I can offer for suggestions. – Stephen Feb 7 '13 at 14:12
No, I'm not trying to sell premium content. I want to make my own post types with a price value of my own, and then direct the new CPT item to the cart for checkout. If this is unrealistic, or not doable, that's fine, I'll work around it. – willbeeler Feb 7 '13 at 18:29
Like just about anything with code it's certainly doable given enough time and effort. But unless you have exceptional requirements that you're not posting in you question it just doesn't make sense. It sounds as if your trying write something custom that's already done in any e-commerce platform. – Stephen Feb 7 '13 at 19:15
up vote 1 down vote accepted

Short answer: You can't.

Long answer: Jigoshop is designed to only allow checkout of our "product" CPT.

In reality, you should have been looking at Jigoshop's template_functions.php file which has our add to cart functions. For security reasons, Jigoshop has checks, absolutely everywhere that the CPT is in fact Jigoshop's own product CPT.

Source: I'm a Core Developer at Jigoshop (it doesn't get more official than this)

share|improve this answer
Ok, thank you for that complete answer. I did find a work around for what I'm trying to do, but I will award you the reputation points for this, I appreciate it. – willbeeler Feb 8 '13 at 14:47
Not a problem :). – Chris Feb 8 '13 at 15:38

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.