Jump to content

where is the ajax_block_product class in prestashop 1.6?


Recommended Posts

Hi there,

 

I'm trying to style product blocks in home page and I'm using prestashop 1.6. But there are some css values add dynamically into the list items. Height of those list items change on mouse hover.

Still I can't figure out where those values coming from.

 

any help?

Link to comment
Share on other sites

Hi there,

 

I'm trying to style product blocks in home page and I'm using prestashop 1.6. But there are some css values add dynamically into the list items. Height of those list items change on mouse hover.

Still I can't figure out where those values coming from.

 

any help?

 

Hello,

 

Need to change the styles in this file

\themes\default-bootstrap\css\product_list.css

 

 

for example height name product

ul.product_list.grid li.hovered h5 {
  min-height: 30px; }
Link to comment
Share on other sites

height of these elemnts is generated in global.js file

 

/themes/your-theme/js/global.js

 

there is a function:

function blockHover(status)
{
	var screenLg = $('body').find('.container').width() == 1170;

	if (screenLg)
		$('.product_list .button-container').hide();
	else
		$('.product_list .button-container').show();

	$(document).off('mouseenter').on('mouseenter', '.product_list.grid li.ajax_block_product .product-container', function(e){
		if (screenLg)
		{
			var pcHeight = $(this).parent().outerHeight();
			var pcPHeight = $(this).parent().find('.button-container').outerHeight() + $(this).parent().find('.comments_note').outerHeight() + $(this).parent().find('.functional-buttons').outerHeight();
			$(this).parent().addClass('hovered').css({'height':pcHeight + pcPHeight, 'margin-bottom':pcPHeight * (-1)});
			$(this).find('.button-container').show();
		}
	});

	$(document).off('mouseleave').on('mouseleave', '.product_list.grid li.ajax_block_product .product-container', function(e){
		if (screenLg)
		{
			$(this).parent().removeClass('hovered').css({'height':'auto', 'margin-bottom':'0'});
			$(this).find('.button-container').hide();
		}
	});
}
  • Like 1
Link to comment
Share on other sites

 

height of these elemnts is generated in global.js file

 

/themes/your-theme/js/global.js

 

there is a function:

function blockHover(status)
{
	var screenLg = $('body').find('.container').width() == 1170;

	if (screenLg)
		$('.product_list .button-container').hide();
	else
		$('.product_list .button-container').show();

	$(document).off('mouseenter').on('mouseenter', '.product_list.grid li.ajax_block_product .product-container', function(e){
		if (screenLg)
		{
			var pcHeight = $(this).parent().outerHeight();
			var pcPHeight = $(this).parent().find('.button-container').outerHeight() + $(this).parent().find('.comments_note').outerHeight() + $(this).parent().find('.functional-buttons').outerHeight();
			$(this).parent().addClass('hovered').css({'height':pcHeight + pcPHeight, 'margin-bottom':pcPHeight * (-1)});
			$(this).find('.button-container').show();
		}
	});

	$(document).off('mouseleave').on('mouseleave', '.product_list.grid li.ajax_block_product .product-container', function(e){
		if (screenLg)
		{
			$(this).parent().removeClass('hovered').css({'height':'auto', 'margin-bottom':'0'});
			$(this).find('.button-container').hide();
		}
	});
}

thanks mate.

that helps :)

Link to comment
Share on other sites

  • 10 months later...

Hi everybody,

 

At first, sorry in advance if my english is not good.

 

I try to make modifications on my default theme.

I want that : when a product is out of stock, the mention "Out of stock" don't appear on the ajax_block_product in the category page and on the main page (text and block), but appear on the product page (text and block).

I want to make this modification, because I want to change the text on the product page. I want to write available on preorder.

I hope you will understand what I'm looking for.

Think in advance.

 

Catia

Link to comment
Share on other sites

  • 6 months later...

Hello, I have a question about the AJAX effect on over.

I don't use it, so in this case I can remove from the li element of the product list the class "ajax_block_product", or it's used for something else and I risk of broke something else? Or do you think the better way would be to delete the blockHover(status) function from the global.js file?

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