PluginProbe
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 4.6.2
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v4.6.2
4.7.2 4.7.1 4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 All 281 releases
← All changes | app/src/WordPress/Cache/CacheService.php +16 -2 4.3.14.6.2 View file →
@@ -141,12 +141,21 @@
141 141
142 142 /**
143 143 * Check if the current page is the customer dashboard page.
144 144 *
145 + * Uses is_page() instead of a URL comparison so dashboard subviews
146 + * with query args (?action=index&model=invoice) are also matched.
147 + *
145 148 * @return bool
146 149 */
147 150 protected function isCustomerDashboardPage(): bool {
148 - return \SureCart::pages()->isCustomerDashboardPageByUrl();
151 + $dashboard_page_id = \SureCart::pages()->getId( 'dashboard' );
152 +
153 + if ( empty( $dashboard_page_id ) ) {
154 + return false;
155 + }
156 +
157 + return is_page( $dashboard_page_id );
149 158 }
150 159
151 160 /**
152 161 * Check if the current page is the checkout page.
@@ -180,13 +189,18 @@
180 189
181 190 /**
182 191 * Check if the current page is a buy page.
183 192 *
193 + * Pretty buy permalinks (/buy/{product-slug}/) rewrite to the
194 + * sc_checkout_product_id query var; sc-buy covers legacy buy links.
195 + *
184 196 * @return bool
185 197 */
186 198 protected function isBuyPage(): bool {
187 199 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
188 - return isset( $_GET['sc-buy'] ) || ! empty( get_query_var( 'sc-buy' ) );
200 + return isset( $_GET['sc-buy'] )
201 + || ! empty( get_query_var( 'sc-buy' ) )
202 + || ! empty( get_query_var( 'sc_checkout_product_id' ) );
189 203 }
190 204
191 205 /**
192 206 * Get SureCart vary cookies.