Shop page cart button issue again #215051
-
Hello,
In my shop page there is 2 style of the cart button and its a bit annoying. Sometimes it has the text with “add to cart” and sometimes just icon.. How can I set it to be constant icon? Photos attached about 2 products which next to each other.
Last time I got an answer for this:
jQuery(‘.woodmart-hover-base’).each(function () {
var $el = jQuery(this),
$elBtn = $el.find(‘.woodmart-add-btn’);
$el.addClass(‘add-small-content’);
$elBtn.addClass(‘wd-action-btn wd-add-cart-btn wd-style-icon’);
});
But its just solve the issue for that lines which has next to sidebar, but the other lines still facing this issue.. What can I do? Because its not professional at all.
Attachments:
You must be
logged in to view attached files.
Hello,
Try to replace the code with the following one instead
function smallBtn(){
jQuery('.woodmart-hover-base').each(function () {
var $el = jQuery(this),
$elBtn = $el.find('.woodmart-add-btn');
$el.addClass('add-small-content');
$elBtn.addClass('wd-action-btn wd-add-cart-btn wd-style-icon');
});
}
smallBtn();
jQuery(document).on('pjax:end', function () {
smallBtn();
});
Regards