$discount_title = ""; } if ($item['error']) { $coupon_style = "style='border:1px solid #ff0000;'"; $title = $item['error']; } else { $coupon_style = ""; $title = ""; } $cart .= "<tr id='cart_item_{$item[ID]}'>" . "<td>" . "<a class='wpmp_cart_delete_item' href='#' onclick='return wpmp_pp_remove_cart_item({$item['ID']})'>" . "<i class='icon icon-trash glyphicon glyphicon-trash'></i>" . "</a>" . "</td>" . "<td class='cart_item_title'>{$item['post_title']}<br>{$variations}" . $cart_item_info . "</td>" . "<td class='cart_item_unit_price' {$discount_style} ><span class='ttip' title='{$discount_title}'>" . $currency_sign . number_format($item[price], 2, ".", "") . "</span></td>" . "<td class=''>" . $currency_sign . number_format($item['discount_amount'], 2, '.', '') . "</td>" . "<td><input style='{$coupon_style}' title='{$title}' type='text' name='cart_items[{$item['ID']}][coupon]' value='{$item['coupon']}' id='{$item['ID']}' class='ttip' size=3 /></td>" . "<td class='cart_item_quantity'><input type='text' name='cart_items[{$item['ID']}][quantity]' value='{$item['quantity']}' size=3 /></td>" . "<td class='cart_item_subtotal amt'>" . $currency_sign . number_format(($item['price'] + $item['prices']) * $item['quantity'] - $item['coupon_amount'] - $item['discount_amount'], 2, ".", "") . "</td>" . "</tr>"; } } } $extra_row = ''; $cart .= apply_filters('wpmp_ckeckout_extra_row', $extra_row); $cart .= "\n\n<tr><td colspan=5 align=right>" . __("Cart Subtotal:", "wpmarketplace") . "</td><td class='amt' id='wpmp_cart_subtotal'>" . $currency_sign . wpmpz_get_cart_total() . "</td></tr>\n" . $tax_row . "\n\n\n" . $shipping_row . "\n" . $grand_total . "\n</table>\n\n\n\n\n\n"; echo $cart; ?> <p id="order_comments_field" class="form-row notes"> <label class="" for="order_comments"><?php echo __("Order Notes", "wpmarketplace"); ?> </label> <textarea rows="2" cols="5" placeholder="Notes about your order, e.g. special notes for delivery." id="order_comments" class="input-text" name="order_comments"></textarea> </p> <button id="order_back" class="button btn" type="button"><?php echo __("Back", "wpmarketplace"); ?> </button> <button id="order_btn" class="button btn btn-success" type="submit"><?php echo __("Place Order", "wpmarketplace");
//echo "<pre>"; print_r($item); echo "</pre>"; if ($item['variations']) { $variations .= "<small><i>" . implode(", ", $item['variations']) . "</i></small>"; } if ($item['coupon_amount']) { $discount_amount = $item['coupon_amount']; $discount_style = "style='color:#008000; text-decoration:underline;'"; $discount_title = 'Discounted $' . $discount_amount . " for coupon code '{$item['coupon']}'"; } else { $discount_amount = ""; $discount_style = ""; $discount_title = ""; } if ($item['error']) { $coupon_style = "style='border:1px solid #ff0000;'"; $title = $item['error']; } else { $coupon_style = ""; $title = ""; } $cart .= "<tr id='cart_item_{$item[ID]}'>" . "<td>" . "<a class='wpmp_cart_delete_item' href='#' onclick='return wpmp_pp_remove_cart_item({$item['ID']})'>" . "<i class='icon icon-trash glyphicon glyphicon-trash'></i>" . "</a>" . "</td>" . "<td class='cart_item_title'>{$item['post_title']}<br>{$variations}" . $cart_item_info . "</td>" . "<td class='cart_item_unit_price' {$discount_style} ><span class='ttip' title='{$discount_title}'>" . $currency_sign . number_format($item[price], 2, ".", "") . "</span></td>" . "<td class=''>" . $currency_sign . number_format($item['discount_amount'], 2, '.', '') . "</td>" . "<td><input style='{$coupon_style}' title='{$title}' type='text' name='cart_items[{$item['ID']}][coupon]' value='{$item['coupon']}' id='{$item['ID']}' class='ttip' size=3 /></td>" . "<td class='cart_item_quantity'><input type='text' name='cart_items[{$item['ID']}][quantity]' value='{$item['quantity']}' size=3 /></td>" . "<td class='cart_item_subtotal amt'>" . $currency_sign . number_format(($item['price'] + $item['prices']) * $item['quantity'] - $item['coupon_amount'] - $item['discount_amount'], 2, ".", "") . "</td>" . "</tr>"; } } } wpmpz_get_cart_total(); $extra_row = ''; $cart .= apply_filters('wpmp_cart_extra_row', $extra_row); $cart .= "\n\n<tr><td colspan=6 align=right class='text-right'>" . __("Total:", "wpmarketplace") . "</td><td class='amt' id='wpmp_cart_total'>" . $currency_sign . number_format((double) str_replace(',', '', wpmpz_get_cart_total()), 2) . "</td></tr>\n<tr><td colspan=2><button type='button' class='btn btn-info ' onclick='location.href=\"" . $settings['continue_shopping_url'] . "\"'><i class='icon-white icon-repeat glyphicon glyphicon-repeat'></i> " . __("Continue Shopping", "wpmarketplace") . "</button></td><td colspan=4 align=right class='text-right'><button class='btn btn-primary' type='button' onclick='document.getElementById(\"cart_form\").submit();'><i class='icon-white icon-edit glyphicon glyphicon-edit'></i> " . __("Update Cart", "wpmarketplace") . "</button> <button class='btn btn-success' type='button' onclick='location.href=\"" . get_permalink($settings['check_page_id']) . "\"'><i class='glyphicon glyphicon-shopping-cart icon-white icon-shopping-cart'></i> " . __("Checkout", "wpmarketplace") . "</button></td></tr>\n</table>\n\n</form></div>\n\n<script language='JavaScript'>\n<!--\n function wpmp_pp_remove_cart_item(id){\n \n if(!confirm('Are you sure?')) return false;\n jQuery('#cart_item_'+id+' *').css('color','#ccc');\n jQuery.post('" . home_url('?wpmp_remove_cart_item=') . "'+id\n ,function(res){ \n var obj = jQuery.parseJSON(res);\n \n jQuery('#cart_item_'+id).fadeOut().remove(); \n jQuery('#wpmp_cart_total').html(obj.cart_total); \n jQuery('#wpmp_cart_discount').html(obj.cart_discount); \n jQuery('#wpmp_cart_subtotal').html(obj.cart_subtotal); });\n return false;\n }\n function wpmp_pp_remove_cart_item2(id,item){\n if(!confirm('Are you sure?')) return false;\n jQuery('#cart_item_'+id+'_'+item+' *').css('color','#ccc');\n jQuery.post('" . home_url('?wpmp_remove_cart_item=') . "'+id + '&item_id='+item \n ,function(res){ \n var obj = jQuery.parseJSON(res);\n \n jQuery('#cart_item_'+id+'_'+item).fadeOut().remove(); \n jQuery('#wpmp_cart_total').html(obj.cart_total); \n jQuery('#wpmp_cart_discount').html(obj.cart_discount); \n jQuery('#wpmp_cart_subtotal').html(obj.cart_subtotal); });\n return false;\n }\n \njQuery(function(){\n jQuery('.ttip').tooltip();\n});\n \n//-->\n</script>\n\n"; if (count($cart_data) == 0) { $cart = __("No item in cart.", "wpmarketplace") . "<br/><a href='" . $settings['continue_shopping_url'] . "'>" . __("Continue shopping", "wpmarketplace") . "</a>"; }