mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Merge branch 'trunk' into PCP-417-new-feature---pay-upon-invoice
This commit is contained in:
commit
564caa418c
2 changed files with 14 additions and 3 deletions
|
@ -14,6 +14,9 @@ nfs_mount_enabled: false
|
|||
mutagen_enabled: false
|
||||
use_dns_when_possible: true
|
||||
composer_version: "1"
|
||||
hooks:
|
||||
pre-start:
|
||||
- exec-host: "mkdir -p .ddev/wordpress/wp-content/plugins/${DDEV_PROJECT}"
|
||||
web_environment:
|
||||
- WP_VERSION=5.9.3
|
||||
- WP_LOCALE=en_US
|
||||
|
|
|
@ -522,11 +522,10 @@ class SmartButton implements SmartButtonInterface {
|
|||
*/
|
||||
public function button_renderer() {
|
||||
$product = wc_get_product();
|
||||
|
||||
if (
|
||||
! is_checkout() && is_a( $product, \WC_Product::class )
|
||||
&& (
|
||||
$product->is_type( array( 'external', 'grouped' ) )
|
||||
|| ! $product->is_in_stock()
|
||||
&& ( ! apply_filters( 'woocommerce_paypal_payments_product_supports_payment_request_button', ! $product->is_type( array( 'external', 'grouped' ) ) && $product->is_in_stock(), $product )
|
||||
)
|
||||
) {
|
||||
|
||||
|
@ -548,6 +547,15 @@ class SmartButton implements SmartButtonInterface {
|
|||
* Renders the HTML for the credit messaging.
|
||||
*/
|
||||
public function message_renderer() {
|
||||
$product = wc_get_product();
|
||||
|
||||
if (
|
||||
! is_checkout() && is_a( $product, \WC_Product::class )
|
||||
&& ( ! apply_filters( 'woocommerce_paypal_payments_product_supports_payment_request_button', ! $product->is_type( array( 'external', 'grouped' ) ) && $product->is_in_stock(), $product )
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
echo '<div id="ppcp-messages" data-partner-attribution-id="Woo_PPCP"></div>';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue