mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
Merge pull request #353 from helgatheviking/issues/234-supports
This commit is contained in:
commit
e6775ce3fe
1 changed files with 11 additions and 3 deletions
|
@ -522,11 +522,10 @@ class SmartButton implements SmartButtonInterface {
|
||||||
*/
|
*/
|
||||||
public function button_renderer() {
|
public function button_renderer() {
|
||||||
$product = wc_get_product();
|
$product = wc_get_product();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
! is_checkout() && is_a( $product, \WC_Product::class )
|
! 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 )
|
||||||
$product->is_type( array( 'external', 'grouped' ) )
|
|
||||||
|| ! $product->is_in_stock()
|
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
@ -548,6 +547,15 @@ class SmartButton implements SmartButtonInterface {
|
||||||
* Renders the HTML for the credit messaging.
|
* Renders the HTML for the credit messaging.
|
||||||
*/
|
*/
|
||||||
public function message_renderer() {
|
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>';
|
echo '<div id="ppcp-messages" data-partner-attribution-id="Woo_PPCP"></div>';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue