parent
0189c54e03
commit
dddac1236f
@ -0,0 +1,33 @@ |
||||
<ul class="wcsatt-options-prompt-radios"> |
||||
<li class="wcsatt-options-prompt-radio"> |
||||
<label class="wcsatt-options-prompt-label wcsatt-options-prompt-label-one-time"> |
||||
<input class="wcsatt-options-prompt-action-input" |
||||
type="radio" |
||||
name="subscribe-to-action-input" |
||||
value="no" /> |
||||
<div class="wcsatt-options-prompt-action"> |
||||
One-time purchase for |
||||
<b class="woocommerce-Price-amount"> |
||||
{% if fn('wc_get_price_to_display', product, {'price': product.get_regular_price }) > fn('wc_get_price_to_display', product, {'price': product.get_sale_price }) %} |
||||
<del>{{ fn('wc_price', fn('wc_get_price_to_display', product, {'price': product.get_regular_price })) }}</del> |
||||
<ins>{{ fn('wc_price', fn('wc_get_price_to_display', product, {'price': product.get_sale_price })) }}</ins> |
||||
{% else %} |
||||
{{ fn('wc_price', fn('wc_get_price_to_display', product, {'price': product.get_regular_price })) }} |
||||
{% endif %} |
||||
</b> |
||||
</div> |
||||
</label> |
||||
</li> |
||||
|
||||
<li class="wcsatt-options-prompt-radio"> |
||||
<label class="wcsatt-options-prompt-label wcsatt-options-prompt-label-subscription"> |
||||
<input class="wcsatt-options-prompt-action-input" |
||||
type="radio" |
||||
name="subscribe-to-action-input" |
||||
value="yes" /> |
||||
<span class="wcsatt-options-prompt-action"> |
||||
{{ subscription_cta | raw }} |
||||
</span> |
||||
</label> |
||||
</li> |
||||
</ul> |
@ -1,55 +1,9 @@ |
||||
<?php |
||||
/** |
||||
* Product Subscription Options Radio Prompt Template. |
||||
* |
||||
* Override this template by copying it to 'yourtheme/woocommerce/single-product/product-subscription-options-prompt-radio.php'. |
||||
* |
||||
* On occasion, this template file may need to be updated and you (the theme developer) will need to copy the new files to your theme to maintain compatibility. |
||||
* We try to do this as little as possible, but it does happen. |
||||
* When this occurs the version of the template file will be bumped and the readme will list any important changes. |
||||
* |
||||
* @version 4.1.0 |
||||
*/ |
||||
use Timber\Timber; |
||||
|
||||
// Exit if accessed directly. |
||||
if ( ! defined( 'ABSPATH' ) ) { |
||||
exit; |
||||
} |
||||
global $product; |
||||
?> |
||||
$product = wc_get_product(); |
||||
|
||||
<style> |
||||
.amount { |
||||
color: #1A1A1A; |
||||
font-weight: 600; |
||||
} |
||||
</style> |
||||
|
||||
<ul class="wcsatt-options-prompt-radios"> |
||||
<li class="wcsatt-options-prompt-radio"> |
||||
<label class="wcsatt-options-prompt-label wcsatt-options-prompt-label-one-time"> |
||||
<input class="wcsatt-options-prompt-action-input" type="radio" name="subscribe-to-action-input" value="no" /> |
||||
<div class="wcsatt-options-prompt-action"> |
||||
One-time purchase for |
||||
<b class="woocommerce-Price-amount"> |
||||
<?php |
||||
$regular_price = $product->get_regular_price(); |
||||
$sale_price = $product->get_sale_price(); |
||||
|
||||
if ( $sale_price && $regular_price > $sale_price ) { |
||||
echo '<del>' . wc_price( $regular_price ) . '</del> <ins>' . wc_price( $sale_price ) . '</ins>'; |
||||
} else { |
||||
echo wc_price( $regular_price ); |
||||
} |
||||
?> |
||||
</b> |
||||
</div> |
||||
</label> |
||||
</li> |
||||
<li class="wcsatt-options-prompt-radio"> |
||||
<label class="wcsatt-options-prompt-label wcsatt-options-prompt-label-subscription"> |
||||
<input class="wcsatt-options-prompt-action-input" type="radio" name="subscribe-to-action-input" value="yes" /> |
||||
<span class="wcsatt-options-prompt-action"><?php echo wp_kses_post( $subscription_cta ); ?></span>
|
||||
</label> |
||||
</li> |
||||
</ul> |
||||
Timber::render( 'shop/product-subscription-options-prompt-radio-block.twig', [ |
||||
'product' => $product, |
||||
'subscription_cta' => $subscription_cta ?? '', // передайте сюда HTML, как делает оригинальный шаблон |
||||
] ); |
Loading…
Reference in new issue