Jump to content

Block cart quantity not updating when going to different pages


Recommended Posts

Hi,

 

I am using a very customized theme in which I moved the block cart to the blocktopmenu. The cart summary on hover is always correct, but the button that says "Cart x products" shows the incorrect number of products when I go to the home page and some of the other product list pages. It keeps changing back and forth. 

 

The strange thing is that the number of products updates correctly on my local computer installation, but it doesn't work online on the true site and I am using all the same files. I don't know what is different between them, except that I have SSL enabled online. 

 

The block cart is hooked to actionCartListOverride, displayHeader, and displayTop. If I switch back to the default theme, the cart products number works. 

 

I tried moving some code from the blockuserinfo.php to blocktopmenu.php but it still won't work. 

 

I am on 1.5.6 and recently upgraded from 1.5.2. I customized my theme from the 1.5.2 default theme files, but I have been trying to update them with the newer code of the 1.5.6 default theme.

 

Does anyone have an idea of how to troubleshoot this? Nothing I've tried works. Thank you. 

Link to comment
Share on other sites

OK, let me try again. I have a hunch that I need to put this code from blockuserinfo.php somewhere in blocktopmenu.php. Can someone please advise where to put it? The blocktopmenu.php is very complex and since I don't understand smarty, I haven't been able to figure out where to place that code:

	public function hookTop($params)
	{
		if (!$this->active)
			return;

		$this->smarty->assign(array(
			'cart' => $this->context->cart,
			'cart_qties' => $this->context->cart->nbProducts(),
			'logged' => $this->context->customer->isLogged(),
			'customerName' => ($this->context->customer->logged ? $this->context->customer->firstname.' '.$this->context->customer->lastname : false),
			'firstName' => ($this->context->customer->logged ? $this->context->customer->firstname : false),
			'lastName' => ($this->context->customer->logged ? $this->context->customer->lastname : false),
			'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order'
		));
		return $this->display(__FILE__, 'blockuserinfo.tpl');
	} 
Link to comment
Share on other sites

  • 2 weeks later...

Dear all,
We would like the quantity option next to the add to cart button where the user can specify the quantity and press add to cart and the specific quantity is added directly instead of the current option where you need to click the "Cart" to increase the quantity after pressing the initial add to cart option

http://imantra.in/khulla_kharido/ this is what we are working  and we wish to have a quantity add field before the add to cart button similar to this reference link: http://delhilibrary.com/prestashop/index.php?id_category=3&controller=category
On the product listing page

We tried adding the quantity field box which you can see on the following page but which is currently not rightly placed...(http://imantra.in/khulla_kharido/en/3-atta)
But this doesn't work or is placed properly.. if you add a different quantity you will see that it does not add that specific quantity.

Thank you

Link to comment
Share on other sites

Dear all,

We would like the quantity option next to the add to cart button where the user can specify the quantity and press add to cart and the specific quantity is added directly instead of the current option where you need to click the "Cart" to increase the quantity after pressing the initial add to cart option

 

http://imantra.in/khulla_kharido/ this is what we are working  and we wish to have a quantity add field before the add to cart button similar to this reference link: http://delhilibrary.com/prestashop/index.php?id_category=3&controller=category

On the product listing page

 

We tried adding the quantity field box which you can see on the following page but which is currently not rightly placed...(http://imantra.in/khulla_kharido/en/3-atta)

But this doesn't work or is placed properly.. if you add a different quantity you will see that it does not add that specific quantity.

 

Thank you

this topic is not related to this case.

and moreover, it's enough to post it in one thread ;)

please continue discussion here: http://www.prestashop.com/forums/topic/296125-add-quantity-box-to-product-list-not-working/ (your original thread)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...