コード例 #1
0
ファイル: ajax.php プロジェクト: fedeB-IT-dept/fedeB_website
                break;
        }
        /*	Update order content	*/
        update_post_meta($elementIdentifier, '_order_postmeta', $order_meta);
        echo wpshop_orders::order_content(get_post($elementIdentifier));
        break;
        //	Load product list
    //	Load product list
    case 'ajax_load_product_list':
        $product_per_page = 6;
        $current_order_id = isset($_POST['order_id']) && $_POST['order_id'] > 0 ? $_POST['order_id'] : 0;
        $current_page = isset($_POST['page']) && $_POST['page'] > 0 ? $_POST['page'] : 1;
        if ($current_order_id > 0) {
            $product_list_for_selection_pagination = '<div class="dialog_listing_pagination_container alignright" >' . paginate_links(array('base' => '#', 'current' => $current_page, 'total' => $wp_query->max_num_pages, 'type' => 'list', 'prev_next' => false)) . '</div>';
            wp_reset_query();
            $product_association_box = '<div id="product_selection_dialog_msg" class="wpshopHide wpshopPageMessage wpshopPageMessage_Updated" >&nbsp;</div><div id="product_listing_container" ><form action="' . WPSHOP_AJAX_FILE_URL . '" id="wpshop_order_selector_product_form" ><input type="hidden" name="list_has_been_modified" id="list_has_been_modified" value="" /><input type="hidden" name="post" value="true" /><input type="hidden" name="order_id" value="' . $current_order_id . '" /><input type="hidden" name="elementCode" value="ajax_add_product_to_order" />' . wpshop_products::custom_product_list() . '</form></div>
<script type="text/javascript" >
wpshop(document).ready(function(){
jQuery(".wpshop_product_cb_dialog").click(function(){
	jQuery("#list_has_been_modified").val("yes");
});

/*	If click on quantity change, check the box	*/
jQuery(".order_product_action_button.qty_change").click(function(){
	jQuery(this).parent("td").parent("tr").children("td:first").children("input").prop("checked", true);
});

jQuery(".dialog_listing_pagination_container ul.page-numbers li a").click(function(){
	go_to_selected_page = true;
	if((jQuery("#list_has_been_modified").val() == "yes") && !confirm(wpshopConvertAccentTojs("' . __('Are you sure you want to change page without saving current selection?', 'wpshop') . '"))){
		go_to_selected_page = false;