Password Protected Product showing without password entry

Hey there

I have a set of products that are password protected and I have created a woocommerce_single page template that includes a mini-cart to display them but this appears to not work as intended. The page displays without a password prompt and when trying to add the product to the cart it silently errors and doesn’t add, which you can see in the notifications if you view the cart.

Is there a way I can continue to use the woocommerce_single template and have the password protection work correctly? Or am I stuck having to use the far less attractive standard product page?

You can see the issue here:
https://paulaglenphotography.co.nz/product/fergusson-flame/
https://paulaglenphotography.co.nz/cart/

Hi @ConceptFusion,

Thanks for reaching out.
It is not very clear how you have protected the Product with a password. If you are using any 3rd Party plugin, I would suggest you contact the plugin author on this and let us know the feedback from them.
Please remember that we don’t have any control over the code, and also don’t provide any support for it.

Thanks

Thanks for getting back to me @tristup
The page is just password protected with the default woocommerce/wordpress password setting.
The Cornerstone page is a standard woocommerce_single template with minimal/basic style updates only using the add-to-cart-form and mini-cart elements and conditionally set for products in of the specific product category.

If I remove the product-specific condition from the woocommerce_single template and revert to the standard out-of-the-box default woocommerce product view the password field is presented correctly.

This leads me to assume it is a bug in the woocommerce_single template that is preventing the native woocommerce password-protected feature from correctly restricting viewing the page and displaying the required password field.

I can provide a login to the site so you can see what I mean if it helps :slight_smile:

Cheers
Simon

Hi Simon,

Thanks for the details on WooCommerce single template. Can you please explain the steps you followed, so we can replicate the issue at our end for further investigation?

Thanks

Hey @tristup, apologies for the delay getting back to you… busy weekend :slight_smile:

The steps I took:

I created a series of woo-commerce variable products, with visibility set to hidden (so as to not appear in the shop catalog), and added a standard WordPress post/product password.

I then created a woocommerce_single template with product description, image, add-to-cart form, and mini-cart elements, and conditionally applied the template to the product category for the product series above.

The result is that the product displays without prompting for the password but when adding it to the cart it fails as it is password protected. If the password has previously been entered while not using the woocommerce_single template view everything works as expected, which is why I was initially having a hard time nailing down the bug.

For now, I have reverted to the standard woo-commerce product template, but as you can see from the screenshot above the intention is to better encapsulate the shopping experience with the live cart view on the product page necessitating the custom design.

Hello @ConceptFusion,

Thanks for updating in! Please understand that the Password protected is the content and other data. The password field will display along with the “The Content” area. When you create a custom single-product layout, you may need to add a condition to layout elements that it will only display when the password is correct. Regretfully this condition is not yet available at the moment. We already have requested our Developers to add this condition so that we can check if the post/page has a password or not. I will bump our feature request and at least get some feedback from our developers.

Best Regards.

ok, thanks for the update @ruenel.

I can see that there is a “content area” element that is used when applying a themeco template but that element doesn’t seem to be available to use directly (it says I don’t have permission to inspect the element type).

Upon further investigation, it seems, as per your explanation, the password field at least displays if I include the product-long-description element which is effectively “the post content” (I had been using the product-short-description element/field)… but obviously the rest of the content displays regardless.

I guess a password-protected product with a custom layout would be a bit of an edge case, but it will be great to have the ability to do this in the future with the aid of the custom condition and post content elements as this is a powerful design addition to Cornerstone that, now I know it exists, I want to use all the time!

Cheers
Simon

Hello Simon,

The Content Area is a deprecated and classic element. I was referring to the “The Content” dynamic element.

Best Regards.

I don’t see “The Content” :wink:

Scratch that… with Woocommerce installed it appears the “Product Long Description” element IS the “The Content” element… but doesn’t change my problem :smiley:

Screenshot 2023-08-21 at 5.03.20 PM

Hey @ConceptFusion,

We apologize for the back and forth. I have replicated the issue in my test site so I suspect this is a bug which I’m now going to post this in our internal issue tracker so that this will be queued to be investigated by our development team.

There is no workaround for now. Please stay tuned if there’d be updates on this in our Changelog.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.