Skip to content

Commit

Permalink
Ensure order attribution inputs are not removed when shortcode cart i…
Browse files Browse the repository at this point in the history
…s updated (#9038)
  • Loading branch information
mdmoore authored Jul 9, 2024
1 parent 6d4e054 commit 1c18a0d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/9001-tokenized-prb-order-origin
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fix
Comment: Bug fix for PRB feature behind a flag.


Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,29 @@ public function display_express_checkout_buttons() {
} else {
$this->payment_request_button_handler->display_payment_request_button_html();
}

if ( is_cart() ) {
add_action( 'woocommerce_after_cart', [ $this, 'add_order_attribution_inputs' ], 1 );
} else {
$this->add_order_attribution_inputs();
}

?>
<wc-order-attribution-inputs id="wcpay-express-checkout__order-attribution-inputs"></wc-order-attribution-inputs>
</div >
<?php
$this->display_express_checkout_separator_if_necessary( $separator_starts_hidden );
}
}

/**
* Add order attribution inputs to the page.
*
* @return void
*/
public function add_order_attribution_inputs() {
echo '<wc-order-attribution-inputs id="wcpay-express-checkout__order-attribution-inputs"></wc-order-attribution-inputs>';
}

/**
* Check if the pay-for-order flow is supported.
*
Expand Down

0 comments on commit 1c18a0d

Please sign in to comment.