Advertisement
dkplayer

woocommerce bono external product new tab

Jul 8th, 2021 (edited)
1,083
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1.  <?php
  2.  
  3. /**
  4.  * @version 3.4.0
  5.  * подробнее: https://www.k7d.ru/programmirovanie/bono-wordpress-i-partnerskiy-tovar-woocommerce/
  6.  */
  7.  
  8. defined( 'ABSPATH' ) || exit;
  9.  
  10. /**
  11.  * @var string $product_url
  12.  * @var string $button_text
  13.  */
  14.  
  15. do_action( 'woocommerce_before_add_to_cart_form' ); ?>
  16.  
  17. <form class="cart" action="<?php echo esc_url( $product_url ); ?>" method="get" target="_blank">
  18.     <?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
  19.  
  20.     <button type="submit" class="single_add_to_cart_button button alt type-external"><?php echo esc_html( $button_text ); ?></button>
  21.  
  22.     <?php wc_query_string_form_fields( $product_url ); ?>
  23.  
  24.     <?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>
  25. </form>
  26.  
  27. <?php do_action( 'woocommerce_after_add_to_cart_form' ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement