Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /var/www/laciasmara.com/public_html/shop/application/views/themes/3/ajax/ |
Upload File : |
<?php $cart = $this->cart->contents(); ?> <?php $grandtotal = 0; ?> <?php if ($cart != null) : ?> <?php $count = 0; ?> <?php foreach ($cart as $item) : ?> <?php $count++; ?> <div class="cart_box_body_item clearfix"> <div class="crt_img"><img src="<?= base_url() . get_thumbnail($item['id']); ?>" /></div> <div class="crt_desc"> <strong><?= ucwords($item['name']); ?></strong><br> <span><?= get_attribute_name($item['options']['attribute_detail_ids']); ?> <?= $item['options']['sku']; ?></span><!-- <br> <?= ucwords(get_brand_name($item['id'])); ?> --> <div class="crt_qtyx_box"> <span>Qty <?= $item['qty']; ?></span> <span> <?php if ($this->session->userdata('site_lang') == 'english' && $item['options']['stock_condition'] == 'In Stock') { echo 'In Stock'; } else if ($item['options']['stock_condition'] == 'In Stock') { echo 'Tersedia'; } else if ($item['options']['stock_condition'] == 'Indent') { echo 'Indent'; } else { echo 'Produk Tidak Tersedia'; } ?></span> </div> <a href="#" id="remove<?= $count; ?>"> <i class="fa fa-trash"></i> <?php if ($this->session->userdata('site_lang') == 'english') { echo 'Remove'; } else { echo 'Hapus'; } ?> </a> </div> <div class="crt_price"> <?= number_format($item['price'], 0, ',', '.'); ?> IDR <br> <?php if (isset($item['options']['indent_message'])) : ?> <?= $item['options']['indent_message']; ?> <?php endif; ?> </div> </div> <?php $grandtotal = $grandtotal + $item['subtotal']; ?> <script> jQuery('#remove<?= $count; ?>').on('click', function(e) { e.preventDefault(); var rowid = '<?= $item['rowid']; ?>'; remove_cart(rowid); }); </script> <?php endforeach; ?> <div class="total total_all clearfix"> <div class="crt_desc"><strong>Total</strong></div> <div class="crt_price"><?= number_format($grandtotal, 0, ',', '.'); ?> IDR</div> </div> <?php $reseller_id = $this->db->select('reseller_id')->from('customers')->where('id_customers', $this->session->userdata('customer')['customer_id'])->get()->row()->reseller_id; if ($reseller_id == NULL) : ?> <div class="total total_all clearfix"> <p> <?php if ($this->session->userdata('site_lang') == 'english') { $more = 1500000 - $grandtotal; echo ($grandtotal >= 1500000) ? "Congrats! you have up to Rp. 100.000 <strong>Free Shipping</strong>" : "Add another Rp." . number_format($more, 0, ',', '.') . " to enjoy free shipping up to Rp. 100.000"; } else { $more = 1500000 - $grandtotal; echo ($grandtotal >= 1500000) ? "Selamat! kamu dapet <strong>Gratis Ongkir</strong> sampai dengan Rp. 100.000" : "Belanja Rp." . number_format($more, 0, ',', '.') . " lagi untuk mendapatkan gratis ongkir sampai dengan Rp. 100.000 lho! Yuk nambah..."; } ?> </p> </div> <?php else : ?> <?php endif; ?> <?php else : ?> <div style="text-align: center;"> <p><?php if ($this->session->userdata('site_lang') == 'english') { echo 'Empty Cart'; } else { echo 'Keranjang Kosong'; } ?></p> </div> <?php endif; ?> <script> function remove_cart(rowid) { jQuery.ajax({ 'url': '<?= base_url(); ?>' + 'ajax/ajax_remove_cart', 'type': 'POST', 'data': { 'rowid': rowid, '<?= $this->security->get_csrf_token_name(); ?>': '<?= $this->security->get_csrf_hash(); ?>' }, 'success': function(data) { /*---success----*/ var cart = JSON.parse(data); jQuery('#cart_body').html(cart.cart_content); jQuery('.cartCount').html(cart.cart_count); if (cart.cart_count == 0) { jQuery('#processCheckout').hide(); } else { jQuery('#processCheckout').show(); } } }); } </script>