strangerstudios / sitewide-sales

Run Black Friday, Cyber Monday, or other flash sales on your WordPress-powered eCommerce or membership site with WooCommerce, Easy Digital Downloads, and Paid Memberships Pro.
https://sitewidesales.com
GNU General Public License v3.0
3 stars 6 forks source link

Only wrap post content in Sale Period divs if the sale is using a template #162

Closed kimcoleman closed 11 months ago

kimcoleman commented 1 year ago

Is your feature request related to a problem? Please describe. The code here will add sale period-specific divs that wrap the entire post_content of the associated Sale landing page.

https://github.com/strangerstudios/sitewide-sales/blob/dev/classes/class-swsales-landing-pages.php#L189-L241

This is not needed if the sale isn't using a template.

Describe the solution you'd like We should put a check in this logic to reference if the sale has a 'template' and, if not, return the content without the filter.

Additional context This is especially weird since the same landing page (e.g. the Membership Levels page as we use at PMPro) is used for multiple sales. When the sale is not actively running, that whole page remains wrapped in the post sale div. Not necessary.

kimcoleman commented 1 year ago

I asked AI for help writing this code and here's what was output. This is not tested:

`/**

andrewlimaza commented 11 months ago

This has been added to the latest dev branch! 👍