Merge pull request #20138 from woocommerce/fix/20133
Use GET in external product form
This commit is contained in:
commit
231c8da566
|
@ -17,12 +17,21 @@
|
|||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$product_url_parts = wp_parse_url( $product_url );
|
||||
$query_string = array();
|
||||
|
||||
if ( ! empty( $product_url_parts['query'] ) ) {
|
||||
parse_str( $product_url_parts['query'], $query_string );
|
||||
}
|
||||
|
||||
do_action( 'woocommerce_before_add_to_cart_form' ); ?>
|
||||
|
||||
<form class="cart" action="<?php echo esc_url( $product_url ); ?>" method="post">
|
||||
<form class="cart" action="<?php echo esc_url( $product_url ); ?>" method="get">
|
||||
<?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
|
||||
|
||||
<button type="submit" name="add-to-cart" class="single_add_to_cart_button button alt"><?php echo esc_html( $button_text ); ?></button>
|
||||
<button type="submit" class="single_add_to_cart_button button alt"><?php echo esc_html( $button_text ); ?></button>
|
||||
|
||||
<?php wc_query_string_form_fields( $query_string ); ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue