/** * Gets Klarna checkout widget HTML. * Used in KCO widget. * * @param $atts Attributes passed to shortcode * * @since 2.0 * @return HTML string */ function klarna_checkout_get_kco_widget_html($atts = null) { global $woocommerce; ob_start(); if (!defined('WOOCOMMERCE_CART')) { define('WOOCOMMERCE_CART', true); } $woocommerce->cart->calculate_shipping(); $woocommerce->cart->calculate_fees(); $woocommerce->cart->calculate_totals(); ?> <!-- Coupons --> <?php woocommerce_checkout_coupon_form(); ?> <!-- Cart items --> <?php echo $this->klarna_checkout_get_cart_contents_html($atts); ?> <!-- Totals --> <div> <table id="kco-totals"> <tbody> <tr id="kco-page-subtotal"> <td class="kco-col-desc"><?php _e('Subtotal', 'woocommerce-gateway-klarna'); ?> </td> <td id="kco-page-subtotal-amount" class="kco-col-number kco-rightalign"><span class="amount"><?php echo $woocommerce->cart->get_cart_subtotal(); ?> </span></td> </tr> <?php echo $this->klarna_checkout_get_shipping_options_row_html(); // Shipping options ?> <?php echo $this->klarna_checkout_get_fees_row_html(); // Fees ?> <?php echo $this->klarna_checkout_get_coupon_rows_html(); // Coupons ?> <?php echo $this->klarna_checkout_get_taxes_rows_html(); // Taxes ?> <?php /* Cart total */ ?> <tr id="kco-page-total"> <td class="kco-bold"><?php _e('Total', 'woocommerce-gateway-klarna'); ?> </a></td> <td id="kco-page-total-amount" class="kco-rightalign kco-bold"><span class="amount"><?php echo $woocommerce->cart->get_total(); ?> </span></td> </tr> <?php /* Cart total */ ?> </tbody> </table> </div> <!-- Order note --> <?php if ('false' != $atts['order_note']) { ?> <div> <form> <?php if (WC()->session->get('klarna_order_note')) { $order_note = WC()->session->get('klarna_order_note'); } else { $order_note = ''; } ?> <textarea id="klarna-checkout-order-note" class="input-text" name="klarna-checkout-order-note" placeholder="<?php _e('Notes about your order, e.g. special notes for delivery.', 'woocommerce-gateway-klarna'); ?> "><?php echo $order_note; ?> </textarea> </form> </div> <?php } return ob_get_clean(); }
<?php global $woocommerce; $woocommerce_checkout = $woocommerce->checkout(); $isAccordion = etheme_get_option('checkout_accordion'); ?> <?php $woocommerce->show_messages(); ?> <?php woocommerce_checkout_coupon_form(); ?> <div class="<?php if ($isAccordion) { ?> tabs accordion checkout-accordion<?php } else { ?> checkout-default<?php } ?> "> <?php if (!is_user_logged_in()) { ?> <!-- ----------------------------------------------- --> <!-- ------------------- LOGIN --------------------- --> <!-- ----------------------------------------------- -->