Skip to content

Instantly share code, notes, and snippets.

@divienginesupport
Last active January 20, 2022 11:52
Show Gist options
  • Save divienginesupport/78489b83bf2a9d0182692b8399b708b0 to your computer and use it in GitHub Desktop.
Save divienginesupport/78489b83bf2a9d0182692b8399b708b0 to your computer and use it in GitHub Desktop.
jQuery to add Title and Price Overlay
jQuery(document).ready(function($) {
function moveproddetails() {
var shop_module = $('.divi-engine-custom-overlay'),
shop_item = shop_module.find('li.product');
shop_item.each(function() { // Runs through each loop item in the shop
var product_title = $(this).find('.woocommerce-loop-product__title'), // Finds the Product Title
product_price = $(this).find('span.price'), // Finds the Product Price
product_overlay = $(this).find('.et_overlay'); // Finds the Divi Overlay
product_title.detach(); // Detaches the Product Title
product_price.detach(); // Detaches the Product Title
product_overlay.prepend(product_title, product_price); // Adds Product Title and Price to the Overlay
})
}
moveproddetails();
jQuery(document).on('divi_filter_completed', function() {
moveproddetails();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment