Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

qty in shopping_cart.php doesnt update


Guest

Recommended Posts

if i change the value of qty and hit recalculate it doesnt change the qty. i can put 10 and hit recalculate and it reloads with the qty as 1. why doesnt this work? my code for the recalculate button is the same as the stock oscommerce.. what is wrong?

Link to comment
Share on other sites

I have the same problem, but only with products that have option attributes. Any products without options can be updated with no problems. I can't speak for the original poster but I have made changes to application_top.php, but not the 'update_product' bit. Anyone got any ideas??

Link to comment
Share on other sites

if i change the value of qty and hit recalculate it doesnt change the qty. i can put 10 and hit recalculate and it reloads with the qty as 1. why doesnt this work? my code for the recalculate button is the same as the stock oscommerce.. what is wrong?

 

I get errors on every page of your site. IE7 lower left hand corner: Done, but with errors on the page!

I thought this stuff was gonna be easy!!

BACK IT UP BEFORE YOU JACK IT UP!!!!

Link to comment
Share on other sites

I've just compared my site that's not updating the cart to another one we did that works fine and the problem seems to be that the option attributes aren't written into the <form>:

 

<input type="hidden" name="products_id[]" value="55">

 

Instead of:

 

<input type="hidden" name="products_id[]" value="55{3}3{4}12">

 

So something to do with the $products[$i]['id'] bits in shopping_cart.php?? I can't see anything different compared to the same file from the working site though.

Link to comment
Share on other sites

  • 2 weeks later...

My problem turned out to be to do with the CCGV(Trad) contribution. I disabled some of the CCGV code in includes/shopping_cart.php and it fixed it. I can't remember exactly what it was now though I'm afraid.

Link to comment
Share on other sites

My problem turned out to be to do with the CCGV(Trad) contribution. I disabled some of the CCGV code in includes/shopping_cart.php and it fixed it. I can't remember exactly what it was now though I'm afraid.

damn.. cause i run that contrib thats prob whats messing mine up.

Link to comment
Share on other sites

ok im stumped.. this code was changed by ccgv(trad) in classes/shopping_cart.php

 

  if ($this->in_cart($products_id_string)) {
		$this->update_quantity($products_id_string, $qty, $attributes);
		} else {
		$this->contents[$products_id_string] = array('qty' => $qty);
[code]
to
[code]
if ($this->in_cart($products_id)) {
		$this->update_quantity($products_id, $qty, $attributes);
		} else {
		$this->contents[$products_id] = array('qty' => $qty);

or vise versa.. but basically im stuck at this code.

if ($this->in_cart($products_id_string)) {
		$this->update_quantity($products_id_string, $qty, $attributes);
		} else {
		$this->contents[$products_id] = array('qty' => $qty);

this code works. qty can be updated fine. everythings great, BUT say i have a tshirt "gun" in large black, and i add the same shirt over in small black. it will wipe the first one added to the cart and put the new one, when it should add it as a new product. so im stumped.

Link to comment
Share on other sites

  • 1 month later...

Hmm, well that block of code for me looks like this:

 

		  if ($this->in_cart($products_id_string)) {
		$this->update_quantity($products_id_string, $qty, $attributes);
	  } else {
		$this->contents[$products_id_string] = array('qty' => $qty);

 

And it works having two of the same item with different attributes. I can send you the whole file if it's any use?

Link to comment
Share on other sites

Hmm, well that block of code for me looks like this:

 

		  if ($this->in_cart($products_id_string)) {
		$this->update_quantity($products_id_string, $qty, $attributes);
	  } else {
		$this->contents[$products_id_string] = array('qty' => $qty);

 

And it works having two of the same item with different attributes. I can send you the whole file if it's any use?

yea its wierd cause if i use that code my products wont add to the cart with attributes. but i can add more of one product.. but i cant tell what the attributes are in the cart or on admin side. so i wonder what else needs to be changed to get attributes to show up again

Link to comment
Share on other sites

I had *exactly* the same problem last week - even experienced the same problem with the attributes being written

 

<input type="hidden" name="products_id[]" value="55">

 

instead of

 

<input type="hidden" name="products_id[]" value="55{3}3{4}12">

 

The problems seem to start somewhere between installing CCGV and Attribute Sets Plus. Sadly (despite many hours trying to debug) I never found the cause of the problem. I started with a fresh install of OSC and redid the whole thing (taking particular care with CCGV and ASP installs) and the problem cleared itself up....

Link to comment
Share on other sites

I had *exactly* the same problem last week - even experienced the same problem with the attributes being written

 

<input type="hidden" name="products_id[]" value="55">

 

instead of

 

<input type="hidden" name="products_id[]" value="55{3}3{4}12">

 

The problems seem to start somewhere between installing CCGV and Attribute Sets Plus. Sadly (despite many hours trying to debug) I never found the cause of the problem. I started with a fresh install of OSC and redid the whole thing (taking particular care with CCGV and ASP installs) and the problem cleared itself up....

damn that sucks.. i dont have attribute sets plus so i guess the prob is from ccgv

i wonder if the problem lies on the product_info page or the classes/shopping_cart.php cause id just reverse that page to remove the ccgv code and see if it works.

Link to comment
Share on other sites

I'm sure it was just a sloppy install of CCGV on my part the first time. When I redid it the second time it was fine. With ASP over the top (plus a lot of other mods) it was pretty hard to debug so I just started again. Have you got a backup pre-CCGV you can put back?

Link to comment
Share on other sites

I'm sure it was just a sloppy install of CCGV on my part the first time. When I redid it the second time it was fine. With ASP over the top (plus a lot of other mods) it was pretty hard to debug so I just started again. Have you got a backup pre-CCGV you can put back?

nope.. i didnt notice the problem till a long timelater.. if i can norrow it down to one php file i can just revert to original and go from there. or at least use beyond compare to find a difference that might be the cause of the problem.. im hoping its in the class/shoppingcart page cause my product info page is soooo heavily modded its days of work to start from scratch

Link to comment
Share on other sites

well i guess ccgv trad they have a new shoppingcart class file cause i looked in the latest package and mine was alot different.. so i used the new file and my prob is gone.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...