here is the one function in which i am trying to show all nodes of particular, node comes from the order using uc_node_checkout module

whenever i am trying to show code then it will redirects to http://mysite.com/cart page...

please guide me...

i also need features of redirect it to cart when it will submitted by client but here i want to show only checkouted nodes

$user_uid = 1;
 $res = db_query("SELECT * FROM {uc_orders} WHERE uid = %d",$user_id);
 
 while($result = db_fetch_object($res) ) {
 
       $order = uc_order_load($result->order_id);
       $products = $order->products;
 
       if($products){
               foreach($products as $pid => $prod) 
              {
      
                   $node = node_load($prod->data['node_checkout_nid']);
                   print node_view($node,TRUE,TRUE,TRUE);
  
   
             }
  }
}

Comments

asak’s picture

drupizzle’s picture

Does anybody have a patch or code snippet that allows a newly created unpublished node to redirect the user to the cart page rather than the node just like it does with a stock ubercart product that is not a "node checkout" node?

Thanks!

rszrama’s picture

Version: 5.x-1.0 » 6.x-2.x-dev

I am updating the code in uc_node_checkout_nodeapi() for the D6 version to use $arg4. It will only do the redirect if $arg4 is TRUE. In your code example, it is, but I think you're using this incorrectly. That argument should only be TRUE when a node is being displayed as its own page.

rszrama’s picture

Version: 6.x-2.x-dev » 6.x-1.1
Status: Active » Fixed

Actually, this is fixed for 1.1 and I'll backport it when I get a moment.

gb5256’s picture

Sorry to ask also about that, but:

Is this fixed in the 6.x.1.1 or will you include that into the build when you get a moment?
I'm just asking as I installed today the 1.1 and I have the same problem.

I don't want to set you in a hurry, take all time you need.
I apprecitate your work a lot.
thank you.

gb5256

rszrama’s picture

It's been committed to the HEAD of the 6--1 branch, but it won't be wrapped up into a .tar.gz until I make a new release. It should be soon. :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.