4 replies [Last post]
quboblu's picture
Offline
Joined: 02/07/2012
Juice: 11
Was this information Helpful?

Hello everybody,

I'm writing cause when try to update a cart on a website i'm working on, it updates removing an element.

This happen both when the quantity field change and the update button is pressed without changing nothing.

I tried to update the Ubercart version to the 2.7 one, I'm working on D6.22 but i still have the same problem.

May someone of you help me?

Thank you in advance and sorry for my english... I'm italian.

Luca

P.S.
the website i'm working on is temporary available here: http://lab.quboblu.com/gift/it
to try, select on the left the "Donna" menu, you'll see a page with some items, click onto one
of that and the press the "ACQUISTA" button to add the product to the cart. The Shopping bag link on top
of the page will take you to the cart page.

quboblu's picture
Offline
Joined: 02/07/2012
Juice: 11
Re: Updating cart remove an element

No one had this problem before?

I also tried replacing the Ubercart folder with a new one re-downloaded but nothing changed...

Help please!!

end user's picture
Offline
Joined: 01/11/2008
Juice: 1198
Re: Re: Updating cart remove an element

The only issue that I could see is that the cart counts the items once even if you change the quantity for each item it still counts just the product not the quantity. Have you tried a default theme like Garland and see if it happens with that theme?

quboblu's picture
Offline
Joined: 02/07/2012
Juice: 11
Re: Re: Re: Updating cart remove an element

Thank you for reply... I tried to re-activate Garland and it works.

I also made another test, i've removed completely my uc_cart_view_form hook implementation, and now the cart works also on my theme.

I need to customize the aspect of my cart page and I need to implement this hook. I tried to just copy and paste the default implementation of this hook and rename it to gift_uc_cart_view_form but stops working!

This is the original hook:

<?php
function theme_uc_cart_view_form($form) {
 
drupal_add_css(drupal_get_path('module', 'uc_cart') .'/uc_cart.css');

 

$output = '<div id="cart-form-products">'
         
. drupal_render($form['items']) .'</div>';

  foreach (

element_children($form['items']) as $i) {
    foreach (array(
'title', 'options', 'remove', 'image', 'qty') as $column) {
     
$form['items'][$i][$column]['#printed'] = TRUE;
    }
   
$form['items'][$i]['#printed'] = TRUE;
  }

 

// Add the continue shopping element and cart submit buttons.
 
if (($type = variable_get('uc_continue_shopping_type', 'link')) != 'none') {
   
// Render the continue shopping element into a variable.
   
$cs_element = drupal_render($form['continue_shopping']);

   

// Add the element with the appropriate markup based on the display type.
   
if ($type == 'link') {
     
$output .= '<div id="cart-form-buttons"><div id="continue-shopping-link">'
              
. $cs_element .'</div>'. drupal_render($form) .'</div>';
    }
    elseif (
$type == 'button') {
     
$output .= '<div id="cart-form-buttons"><div id="update-checkout-buttons">'
              
. drupal_render($form) .'</div><div id="continue-shopping-button">'
              
. $cs_element .'</div></div>';
    }
  }
  else {
   
$output .= '<div id="cart-form-buttons">'. drupal_render($form) .'</div>';
  }

  return

$output;
}
?>

If I try only to rename it to gift_uc_cart_view_form, refreshing the cache and test, stops working...

I really don't understand...

I didn't understood also the items counting that you said... the cart link is http://lab.quboblu.com/gift/it/cart

quboblu's picture
Offline
Joined: 02/07/2012
Juice: 11
Thank you for reply! I tried

Thank you for reply!

I tried to disable my theme and test the cart with the Garland one and it works.

I also tried to re-activate my theme and removing my implementation of theme_uc_cart_view_form and the cart works.

I made a third test, I just copied and pasted the theme_uc_cart_view_form into my template.php and renamed gift_uc_cart_view_form (gift is the name of my theme) and... it doesn't work!! I used the same code that is in the uc_cart.module!!

Do you know why this happen??

Thank you in advance...
Luca

P.S. the cart url is http://lab.quboblu.com/gift/it/cart