Jump to content

Question on hooks - ShoppingCartValidateProductUpdate


rcuddy

Recommended Posts

Hi all,

 

I'm working on a custom provisioning module which will have several related but different data/information products in it. When the products are added to the cart there's a certain amount of user data entry that needs to be verified before the checkout process.

 

Unfortunately what needs to be verified is different based on which product it is.

 

I'm trying to grab the "add to cart" part and interrupt it with

 function hook_MYMODULE_ShoppingCartValidateProductUpdate($vars)

but unfortunately the $vars it gets don't identify the product itself, only

array
 'a' => string 'confproduct' (length=11)
 'i' => string '0' (length=1)
 'configure' => string 'true' (length=4)
 'previousbillingcycle' => string 'onetime' (length=7)
 'billingcycle' => string 'onetime' (length=7)
 'customfield' => 
   array
     2 => string 'ThisIsATest3' (length=12)
     3 => string '768' (length=3)

 

Now that I'm looking at it again, it looks like 'i' might correspond to $_SESSION['cart']['products' ] ... is this correct? And customfield[num] == the id of the custom field in the data base, so I could look the original product up by the relid...

 

Is this the only way to look this information up, or is there a nicer way to do it? I suppose grabbing it from the session isn't as terrible as I thought at first, but I'm just curious why the $vars doesn't contain the product id itself?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated