Skip to content

Instantly share code, notes, and snippets.

//Open
jQuery( window ).trigger( {
type: 'jet-popup-open-trigger',
popupData: {
popupId: 'jet-popup-<numeric popup ID>',
}
} );
//Close , just trigger click to match the rules in popup setting
jQuery('#jet-popup-<numeric popup ID> .jet-popup__close-button').click();
<?php
function jennsup_custom_checkout_product_validation() {
global $woocommerce;
$cart_items = $woocommerce->cart->cart_contents;
$restrict_product_id = 9787; //your restricted product id
foreach ( $cart_items as $key => $item ) {
$product_id = $item['product_id'] == 0 ? $item['variation_id']: $item['product_id'];
$product_qty = $item['quantity'];
if($product_id == $restrict_product_id) {