Jump to content

Chilly

Recommended Posts

Hi all,

 

I found a thread addressing my problem, but the solution didn't work for me. The users of my site are leaving the default attribute (size, snap color) selected when adding a product to the cart (from the product page). I would like to warn them when this happens, and force them to choose an attribute.

 

I found this resource for adding a java script alert:

http://www.presto-changeo.com/en/content/7-default-attribute-alert

 

And added all the code. But it changed nothing for me. I'm using the Black & White theme. My url is: http://urbanlacejewelry.com/

 

Anyone tried this with the Black & White theme? Do you think this is the problem, that the code is for the default prestashop theme? I don't know what else it could be.

 

Any help, as always, greatly appreciated!

Link to comment
Share on other sites

Your scripts get a bug arround

var CUSTOMIZE_TEXTFIELD = ;

Change the template blockcart.tpl,

var CUSTOMIZE_TEXTFIELD = {$CUSTOMIZE_TEXTFIELD};

with

var CUSTOMIZE_TEXTFIELD = '{$CUSTOMIZE_TEXTFIELD}';

This is a known bug.

 

The method you mentionned proposes you to modify your ajax-cart.js. You haven't done such.

On your early 1.4.x release this should be on line 42 of the mentionned file:

 //for product page 'add' button...
 $('body#product p#add_to_cart input').unbind('click').click(function(){
  ajaxCart.add( $('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null);
  return false;
 });

become:

//for product page 'add' button...
$('body#product p#add_to_cart input').unbind('click').click(function(){
		if (attribute_alert == true)
		{
			if (!confirm(attribute_alert_text))
				return false;
		}

 ajaxCart.add( $('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null);
 return false;
});

 

 

Best,

(d)oekia

  • Like 1
Link to comment
Share on other sites

  • 4 years later...

Your scripts get a bug arround

var CUSTOMIZE_TEXTFIELD = ;
Change the template blockcart.tpl,

var CUSTOMIZE_TEXTFIELD = {$CUSTOMIZE_TEXTFIELD};
with
var CUSTOMIZE_TEXTFIELD = '{$CUSTOMIZE_TEXTFIELD}';
This is a known bug.

 

The method you mentionned proposes you to modify your ajax-cart.js. You haven't done such.

On your early 1.4.x release this should be on line 42 of the mentionned file:

  //for product page 'add' button...
  $('body#product p#add_to_cart input').unbind('click').click(function(){
   ajaxCart.add( $('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null);
   return false;
  });
become:
//for product page 'add' button...
$('body#product p#add_to_cart input').unbind('click').click(function(){
			if (attribute_alert == true)
			{
				if (!confirm(attribute_alert_text))
					return false;
			}
 
  ajaxCart.add( $('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null);
  return false;
});
Best,

(d)oekia

 

Hi

How can l make it Javascript alert when the default attributes are selected for prestashop 1.6.1.5 ?

Edited by askinjew (see edit history)
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...