Popup-Maker icon indicating copy to clipboard operation
Popup-Maker copied to clipboard

Targeting condition Products: With Shipping class doesn't load the popup on the page

Open bimperial opened this issue 4 years ago • 2 comments

Describe the bug

When using 'AND' operator with targeting condition Products: With Shipping class, cart total and cart page, the popup won't display. The debug mode doesn't work as well.

Site information

Popup Maker version: 1.15.0

WordPress version: 5.6.2

PHP version: 7.3.25

Expected behavior

The popup will display on the cart page if the cart total is equivalent to one, and the product has a shipping class.

Current behavior

Adding a targeting condition Products: With Shipping class, the popup won't display and the popup doesn't load on the cart page.

Steps to reproduce

  1. Add a trigger condition time delay/auto open.
  2. Add a targeting condition cart page with an 'AND' operator and products: with shipping class, cart total to one.
  3. Add a product and navigate to the cart page. Popup won't display.
  4. Remove the products: with shipping class, the popup displays with the debug mode enabled but has errors on the console.

Additional context

1 2 3 4

Without targeting condition Products: With Shipping class 5 6

bimperial avatar Feb 24 '21 00:02 bimperial

Hi @bimperial,

I don't think this is a bug.

According to the first condition (with 3 rules), that will never be satisfied.

Here's how I interpret that condition (which is consistent with your and my testing).

Launch the popup when:

  1. I'm on the cart page.
  2. And, my cart has at least 1 product.
  3. And, I'm also on a product page that has a specific shipping class (ID: 41).

Since rules 1 and 2 are mutually exclusive (they can't happen at the same time), the condition will never get satisfied and the popup will never launch. I can't be on the cart page and a product page at the same time in the same browser tab.

Maybe we need a new feature to check for products in the cart with a shipping class? If we had that condition, then we could replace rule 3 with it and the condition will get satisfied:

  1. I'm on the cart page.
  2. And, my cart has at least 1 product.
  3. And, at least 1 product in my cart has a shipping class of xyz.

Thoughts?

Thanks!

marklchaves avatar Oct 04 '21 08:10 marklchaves

We could look at a new condition for that in the WooCommerce Pro extension, but last I checked there are some pretty major limitations in what data is passed to the front end in WooCommerce about items in the cart. So we would in all likelyhood have to also come up with a reliable mechanism for accessing that information.

If we can do that, the list of WooCommerce conditions will go through the roof near instantly, so it should be something to look at. For example there are several other conditions we can't quite fulfill without similar mechanism, such as

  • Product in Cart from Category X
  • Product in Cart has Feature X enabled (subscriptions, memberships, is bundle)
  • Product in Cart is Out of Stock etc.

But those should be discussed in the PopupMaker/WooCommerce-Pro repo.

danieliser avatar Nov 22 '21 23:11 danieliser