Author Topic: Cart gets empty when i browse to a homepage  (Read 3208 times)

q-styler

  • Beginner
  • *
  • Posts: 22
Cart gets empty when i browse to a homepage
« on: March 11, 2009, 12:10:44 pm »
Hi! I have a joomla 1.5.9 with virtuemart 1.1.3.
My cart gets empty when i browse to a homepage but when i browse back to any other page i see the products that I've added to a cart before.
I feel that it's a sessions issue but where I have to look for solution?

beachy

  • Jr. Member
  • **
  • Posts: 277
  • VirtueMart Version: 2.0.22
Re: Cart gets empty when i browse to a homepage
« Reply #1 on: February 13, 2011, 17:19:52 pm »
Hi q-styler,

I was wondering if you ever sorted this problem?  I have just had a customer email me to let me know my site also has the problem.

If you add a product to the cart and then browse to a product page the contents of the cart is still shown. If you now browse to the homepage the cart looks like it is empty. If you go back to another product or category page the contents of the cart reappears!

Has anyone got any ideas why this might be happening?

Site URL is puretree.co.uk
_______
Joomla 2.5.11 Virtuemart 2.0.22
Apache 2.2.24 PHP 5.4.13
Hosted By RochenHost.com - MVS

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10422
  • VirtueMart Version: 3+
Re: Cart gets empty when i browse to a homepage
« Reply #2 on: February 13, 2011, 22:53:08 pm »
beachy,

is caching on for the module?

also, if you use ajax add to cart, does it do the same thing?

and you have some SEF problems.

when i added an item to my cart. I hovered over the show cart link and it said this

"/shop-by-manufacturer?page=shop.cart"
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

Cory1970

  • Beginner
  • *
  • Posts: 8
Re: Cart gets empty when i browse to a homepage
« Reply #3 on: April 15, 2011, 09:51:38 am »
I have the same issue.

View my comments here http://forum.virtuemart.net/index.php?topic=43602.30.

The original poster in this thread was able to solve his problem with a minor hack, but others including me have had no such luck.

Many times it takes 3 or 4 pages before my cart goes empty.

Please let me know if you find a solution.

vipul8789

  • Beginner
  • *
  • Posts: 4
Add to cart not work with this code on browse page
« Reply #4 on: March 31, 2012, 05:12:32 am »
hi

I use VM 1.1.7.

I use VM I change the code for the show add to cart on browse page when child item in product
in that i change some code as per below.

Original Code as per below:


// Add-to-Cart Button
if (USE_AS_CATALOGUE != '1' && $product_price != ""
        && $tpl->get_cfg( 'showAddtocartButtonOnProductList' )
        && !stristr( $product_price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') )
         && !ps_product::product_has_attributes( $db_browse->f('product_id'), true)) {
                      $tpl->set( 'i', $i );
                      $tpl->set( 'product_id', $db_browse->f('product_id') );
                      $tpl->set( 'product_in_stock', $db_browse->f('product_in_stock') );
                      $tpl->set( 'ps_product_attribute', $ps_product_attribute );
                      $products[$i]['form_addtocart'] = $tpl->fetch( 'browse/includes/addtocart_form.tpl.php' );
                      $products[$i]['has_addtocart'] = true;
}

Change to as per below:

// Add-to-Cart Button
//if (USE_AS_CATALOGUE != '1' && $product_price != ""
//&& $tpl->get_cfg( 'showAddtocartButtonOnProductList' )
//&& !stristr( $product_price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') )
//&& !ps_product::product_has_attributes( $db_browse->f('product_id'), true)) {
if (USE_AS_CATALOGUE != '1'
&& $tpl->get_cfg( 'showAddtocartButtonOnProductList' ) ) {
$tpl->set( 'i', $i );
$tpl->set( 'product_id', $db_browse->f('product_id') );
$tpl->set( 'product_in_stock', $db_browse->f('product_in_stock') );
$tpl->set( 'ps_product_attribute', $ps_product_attribute );
$tpl->set( 'product_parent_id', $db_browse->f('product_parent_id') ); // seiko
$products[$i]['form_addtocart'] = $tpl->fetch( 'browse/includes/addtocart_form.tpl.php' );
// $products[$i]['form_addtocart'] = $tpl->fetch( 'product_details/includes/addtocart_form.tpl.php' );
$products[$i]['has_addtocart'] = true;
}


after change this code add to cart button show but not add product after click on add to cart button.

Please tell me show how to possible

Thank you

Regards,
Vipul Patel