Jump to content

[Solved] Add To Cart Button Disappearing Act!


Recommended Posts

I know the add to cart button has a knack of disappearing however this is really weird.

 

My site is www.lighting-deluxe.co.uk

 

As you can see on the product page the add to cart button shows up.

However I have added a button which says "More Details", this is a simple internal link hard coded on the product.tpl page.

 

However, when pressed the add to cart button disappears and the browser shows it having a css rule of "display:none"

 

If you then refresh the browser it works fine.

 

Any ideas about this because its driving me crazy.

 

Thanks

Edited by AZC (see edit history)
Link to comment
Share on other sites

Looks fine for me, it does not get hidden. 

Did you already find solution for this ?

No  :(

What browser are you using?

For me when I go into a product for the first time and click on the more details button, the add to cart button and the whole add to cart section disappears.

image attached...

 

When watching the code on the console whilst clicking the button, I see the display attribute flick through a few options and then fix on "none"

 

I'd send a video but not sure how to do that.

 

Thanks

post-779903-0-74438500-1454540630_thumb.jpg

Link to comment
Share on other sites

Sorry my bad, did not read that right, so when More info is clicked.

 

Think somewhere in block carts javascript file something is triggered but try this.

Add this code to your theme js/modules/blockcart/ajax-cart.js file

	$(document).on('click', '#product_description', function(e){
		e.preventDefault();
	});

for example bit off the start 

$(document).ready(function(){
	ajaxCart.overrideButtonsInThePage();

	$(document).on('click', '.block_cart_collapse', function(e){
		e.preventDefault();
		ajaxCart.collapse();
	});
	$(document).on('click', '.block_cart_expand', function(e){
		e.preventDefault();
		ajaxCart.expand();
	});

		$(document).on('click', '#product_description', function(e){
			e.preventDefault();
		});

That should go to description without triggering any other code.

Link to comment
Share on other sites

Sorry my bad, did not read that right, so when More info is clicked.

 

Think somewhere in block carts javascript file something is triggered but try this.

Add this code to your theme js/modules/blockcart/ajax-cart.js file

	$(document).on('click', '#product_description', function(e){
		e.preventDefault();
	});

for example bit off the start 

$(document).ready(function(){
	ajaxCart.overrideButtonsInThePage();

	$(document).on('click', '.block_cart_collapse', function(e){
		e.preventDefault();
		ajaxCart.collapse();
	});
	$(document).on('click', '.block_cart_expand', function(e){
		e.preventDefault();
		ajaxCart.expand();
	});

		$(document).on('click', '#product_description', function(e){
			e.preventDefault();
		});

That should go to description without triggering any other code.

Phew. Thought I was going crazy. Will try that and let you know how it goes.

Any idea why it would do that? In theory there should be no connection. after all the extra button is not related in any way to anything else.

 

Thanks

Link to comment
Share on other sites

Phew. Thought I was going crazy. Will try that and let you know how it goes.

Any idea why it would do that? In theory there should be no connection. after all the extra button is not related in any way to anything else.

 

Thanks

Nope that hasnt helped. Will keep trying

Link to comment
Share on other sites

OK sorry that did not work but try this.

 

In your product.tpl change your button to 

<div class="blue"><a href="javascript:{ldelim}{rdelim}">More Details</a></div>

then bit down also, added just id

			<!-- More info -->
			<section class="page-product-box">
				<h3 id="product_description" class="page-product-heading">{l s='More info'}</h3>

and in product.js in your theme folder around lines 250-280 add 

				$(document).on('click', '.blue a', function(e){
					e.preventDefault();
					$.scrollTo( '#product_description', 1200 );
				});

Hopefully that should work, I tested similar here 

  • Like 1
Link to comment
Share on other sites

OK sorry that did not work but try this.

 

In your product.tpl change your button to 

<div class="blue"><a href="javascript:{ldelim}{rdelim}">More Details</a></div>

then bit down also, added just id

			<!-- More info -->
			<section class="page-product-box">
				<h3 id="product_description" class="page-product-heading">{l s='More info'}</h3>

and in product.js in your theme folder around lines 250-280 add 

				$(document).on('click', '.blue a', function(e){
					e.preventDefault();
					$.scrollTo( '#product_description', 1200 );
				});

Hopefully that should work, I tested similar here 

That works great.

Thanks a mil.

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...