mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Add checkout detection in product page
This commit is contained in:
parent
4c33f0bee3
commit
f517ac4719
1 changed files with 3 additions and 2 deletions
|
@ -19,8 +19,9 @@ trait ContextTrait {
|
||||||
protected function context(): string {
|
protected function context(): string {
|
||||||
if ( is_product() || wc_post_content_has_shortcode( 'product_page' ) ) {
|
if ( is_product() || wc_post_content_has_shortcode( 'product_page' ) ) {
|
||||||
|
|
||||||
// Detection if "woocommerce-one-page-checkout" is enabled for this product.
|
// Do this check here instead of reordering outside conditions.
|
||||||
if ( is_callable( 'is_wcopc_checkout' ) && is_wcopc_checkout( get_the_ID() ) ) {
|
// In order to have more control over the context.
|
||||||
|
if ( ( is_checkout() ) && ! $this->is_paypal_continuation() ) {
|
||||||
return 'checkout';
|
return 'checkout';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue