<?php
|
|
|
|
/**
|
|
* Provide a public-facing view for the plugin
|
|
*
|
|
* This file is used to markup the public-facing aspects of the plugin.
|
|
*
|
|
* @link https://horizontes.info
|
|
* @since 1.0.0
|
|
*
|
|
* @package Wc_Cdp
|
|
* @subpackage Wc_Cdp/public/partials
|
|
*/
|
|
?>
|
|
|
|
<div class="modal fade" id="wc_cdp_product_bundle_modal" tabindex="-1" role="dialog" aria-labelledby="wc_cdp_product_bundle_modal_label" aria-hidden="true">
|
|
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
|
|
|
|
<h2 class="<?php echo apply_filters( 'wc_cdp_modal_title_class', 'wc_cdp_modal_title' ); ?>" id="wc_cdp_product_bundle_modal_label">
|
|
<?php echo get_option( 'wc_cdp_title' ); ?>
|
|
</h2>
|
|
|
|
<p class="<?php echo apply_filters( 'wc_cdp_modal_description_class', 'wc_cdp_modal_description' ); ?>">
|
|
<?php echo get_option( 'wc_cdp_description' ); ?>
|
|
</p>
|
|
|
|
<form action="<?php echo get_admin_url(); ?>admin-post.php" method="POST">
|
|
|
|
<div class="<?php echo apply_filters( 'wc_cdp_modal_products_row_class', 'wc_cdp_modal_products_row' ); ?>">
|
|
|
|
<?php foreach ($bundle_products as $key => $bundle_product) : ?>
|
|
|
|
<div class="<?php echo apply_filters( 'wc_cdp_modal_product_class', 'wc_cdp_modal_product' ); ?>">
|
|
|
|
<?php echo $bundle_product->get_image(); ?>
|
|
|
|
<h3 class="<?php echo apply_filters( 'wc_cdp_modal_product_title_class', 'wc_cdp_modal_product_title' ); ?>">
|
|
<?php echo $bundle_product->get_title(); ?>
|
|
</h3>
|
|
|
|
<?php
|
|
if (
|
|
$bundle_products_quantities[$bundle_product->get_id()] <=
|
|
$this->get_product_in_cart_quantity($bundle_product->get_id())
|
|
) :
|
|
?>
|
|
|
|
<p class="<?php echo apply_filters( 'wc_cdp_already_on_cart_class', 'wc_cdp_modal_product_already_on_cart' ); ?>">
|
|
<small>
|
|
<?php echo apply_filters( 'wc_cdp_already_on_cart_text', __('(já está no seu carrinho)', 'wc-cdp') ); ?>
|
|
</small>
|
|
</p>
|
|
|
|
<?php
|
|
else:
|
|
$bundle_products_quantities[$bundle_product->get_id()]--;
|
|
?>
|
|
|
|
<input type="hidden" name="wc_cdp_bundle_products[]" value="<?php echo $bundle_product->get_id() ?>" />
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
<?php if ( $key !== array_key_last($bundle_products) ): ?>
|
|
|
|
<div class="<?php echo apply_filters( 'wc_cdp_modal_product_separator_class', 'wc_cdp_modal_product_separator' ); ?>">
|
|
+
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</div>
|
|
|
|
<div class="<?php echo apply_filters( 'wc_cdp_bundle_amount_class', 'wc_cdp_bundle_amount' ); ?>">
|
|
<?php if ($bundle_coupon): ?>
|
|
<del>
|
|
<?php echo wc_price($bundle_regular_price); ?>
|
|
</del>
|
|
|
|
<ins>
|
|
<?php echo wc_price($bundle_discount_price); ?>
|
|
</ins>
|
|
<?php else: ?>
|
|
<?php echo wc_price($bundle_regular_price); ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<div class="<?php echo apply_filters( 'wc_cdp_bundle_action_row_class', 'wc_cdp_bundle_action_row' ); ?>">
|
|
|
|
<input type="hidden" name="action" value="wc_cdp_add_to_cart" />
|
|
|
|
<?php if ($bundle_coupon): ?>
|
|
<input type="hidden" name="wc_cdp_bundle_coupon" value="<?php echo $bundle_coupon->get_code(); ?>" />
|
|
<?php endif; ?>
|
|
|
|
<button type="submit" class="<?php echo apply_filters( 'wc_cdp_add_to_cart_button_class', 'button wc-forward alt wc_cdp_add_to_cart_button' ); ?>">
|
|
<?php echo apply_filters( 'wc_cdp_add_to_cart_button_text', get_option( 'wc_cdp_add_to_cart_text' ) ); ?>
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|