<?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="font-weight-normal letter-spacing-2 mb-2 text-center" id="wc_cdp_product_bundle_modal_label">
|
|
<span class="text-line-warning d-lg-block px-4 px-lg-0">
|
|
Fazer parzinho é mais legal!
|
|
</span>
|
|
</h2>
|
|
|
|
<p class="text-muted text-center mb-5">
|
|
eu ouvi desconto? é só adicionar os itens abaixo e aproveitar o valor promocional!
|
|
</p>
|
|
|
|
<form action="<?php echo get_admin_url(); ?>admin-post.php" method="POST">
|
|
|
|
<div class="row align-items-center justify-content-center mb-3">
|
|
|
|
<?php foreach ($bundle_products as $key => $bundle_product) : ?>
|
|
|
|
<div class="col-lg-3 align-self-stretch">
|
|
|
|
<?php echo $bundle_product->get_image(); ?>
|
|
|
|
<h6 class="text-uppercase font-weight-bold text-center mt-2">
|
|
<?php echo $bundle_product->get_title(); ?>
|
|
</h6>
|
|
|
|
<?php
|
|
$product_cart_id = WC()->cart->generate_cart_id( $bundle_product->get_id() );
|
|
if ( WC()->cart->find_product_in_cart( $product_cart_id ) ) :
|
|
?>
|
|
|
|
<p class="text-success text-center">
|
|
<small>
|
|
(já está na sua cestinha)
|
|
</small>
|
|
|
|
</p>
|
|
|
|
<?php else: ?>
|
|
|
|
<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="col-lg-auto">
|
|
<h2 class="font-weight-bold text-primary m-0">
|
|
+
|
|
</h2>
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</div>
|
|
|
|
<div class="text-center mb-3 wc_cdp_bundle_amount">
|
|
<del>
|
|
<?php echo wc_price($bundle_regular_price); ?>
|
|
</del>
|
|
|
|
<ins>
|
|
<?php echo wc_price($bundle_discount_price); ?>
|
|
</ins>
|
|
</div>
|
|
|
|
<div class="text-center">
|
|
|
|
<input type="hidden" name="action" value="wc_cdp_add_to_cart" />
|
|
|
|
<input type="hidden" name="wc_cdp_bundle_coupon" value="<?php echo $bundle_coupon->get_code(); ?>" />
|
|
|
|
<button type="submit" class="btn btn-primary text-uppercase text-white font-weight-bold py-1">
|
|
Colocar todos na cestinha!
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|