<div class="pfw-product-table "><table id="pfw-table-40496" class="display" width="100%"></table></div><script>(function($){  $(document).ready(function(){ pfw_init_table("#pfw-table-40496", [{"image":"<a style='display: block; z-index: initial;' class='pfw-lightcase' href='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2018\/11\/Cod-5955-1.jpg'><img style='z-index: -1;' class='pfw-product-image' src='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2018\/11\/Cod-5955-1-500x280.jpg'><\/a>","name":"<a class='pfw-product-name-url' target='_blank' href='https:\/\/oferantichitati.ro\/silverantiques\/product\/vas-condimente-copy-copy-copy\/'>Oval sweetmeat bowl<\/a>","categories":"<a href='https:\/\/oferantichitati.ro\/silverantiques\/product-category\/boluri\/'>BOWLS<\/a>, <a href='https:\/\/oferantichitati.ro\/silverantiques\/product-category\/vintages\/'>VINTAGES<\/a>","raw_price":"","raw_price_max":"","raw_rating":"0","raw_categories":"BOWLS,VINTAGES"},{"image":"<a style='display: block; z-index: initial;' class='pfw-lightcase' href='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2018\/11\/Cod-7204-e1563938668601.jpg'><img style='z-index: -1;' class='pfw-product-image' src='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2018\/11\/Cod-7204-e1563938668601.jpg'><\/a>","name":"<a class='pfw-product-name-url' target='_blank' href='https:\/\/oferantichitati.ro\/silverantiques\/product\/zaharnita-cu-anse-si-capac\/'>Sugar bowl<\/a>","categories":"<a href='https:\/\/oferantichitati.ro\/silverantiques\/product-category\/vintages\/'>VINTAGES<\/a>","raw_price":"","raw_price_max":"","raw_rating":"0","raw_categories":"VINTAGES"},{"image":"<a style='display: block; z-index: initial;' class='pfw-lightcase' href='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2018\/11\/Cod-5812.jpg'><img style='z-index: -1;' class='pfw-product-image' src='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2018\/11\/Cod-5812-500x280.jpg'><\/a>","name":"<a class='pfw-product-name-url' target='_blank' href='https:\/\/oferantichitati.ro\/silverantiques\/product\/bol-dulciuri\/'>Sweets basket<\/a>","categories":"<a href='https:\/\/oferantichitati.ro\/silverantiques\/product-category\/vintages\/'>VINTAGES<\/a>","raw_price":"","raw_price_max":"","raw_rating":"0","raw_categories":"VINTAGES"},{"image":"<a style='display: block; z-index: initial;' class='pfw-lightcase' href='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2019\/02\/7625-anouri.jpg'><img style='z-index: -1;' class='pfw-product-image' src='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2019\/02\/7625-anouri-330x151.jpg'><\/a>","name":"<a class='pfw-product-name-url' target='_blank' href='https:\/\/oferantichitati.ro\/silverantiques\/product\/anouri-servet-rectangulare\/'>Rectangular napkin rings<\/a>","categories":"<a href='https:\/\/oferantichitati.ro\/silverantiques\/product-category\/vintages\/'>VINTAGES<\/a>","raw_price":"","raw_price_max":"","raw_rating":"0","raw_categories":"VINTAGES"},{"image":"<a style='display: block; z-index: initial;' class='pfw-lightcase' href='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2018\/10\/44250.jpg'><img style='z-index: -1;' class='pfw-product-image' src='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2018\/10\/44250-500x280.jpg'><\/a>","name":"<a class='pfw-product-name-url' target='_blank' href='https:\/\/oferantichitati.ro\/silverantiques\/product\/inele-servet-decor-vegetal\/'>Serviette rings<\/a>","categories":"<a href='https:\/\/oferantichitati.ro\/silverantiques\/product-category\/vintages\/'>VINTAGES<\/a>","raw_price":"","raw_price_max":"","raw_rating":"0","raw_categories":"VINTAGES"},{"image":"<a style='display: block; z-index: initial;' class='pfw-lightcase' href='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2019\/02\/4015-caseta-simboluri-crestine.jpg'><img style='z-index: -1;' class='pfw-product-image' src='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2019\/02\/4015-caseta-simboluri-crestine-253x200.jpg'><\/a>","name":"<a class='pfw-product-name-url' target='_blank' href='https:\/\/oferantichitati.ro\/silverantiques\/product\/caseta-simboluri-crestine\/'>Case Christian symbols<\/a>","categories":"<a href='https:\/\/oferantichitati.ro\/silverantiques\/product-category\/vintages\/'>VINTAGES<\/a>","raw_price":"","raw_price_max":"","raw_rating":"0","raw_categories":"VINTAGES"},{"image":"<a style='display: block; z-index: initial;' class='pfw-lightcase' href='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2019\/02\/8138-bol-lobat-1.jpg'><img style='z-index: -1;' class='pfw-product-image' src='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2019\/02\/8138-bol-lobat-1-330x200.jpg'><\/a>","name":"<a class='pfw-product-name-url' target='_blank' href='https:\/\/oferantichitati.ro\/silverantiques\/product\/lobated-bowl-2\/'>Lobated bowl<\/a>","categories":"<a href='https:\/\/oferantichitati.ro\/silverantiques\/product-category\/boluri\/large\/'>Large<\/a>, <a href='https:\/\/oferantichitati.ro\/silverantiques\/product-category\/vintages\/'>VINTAGES<\/a>","raw_price":"","raw_price_max":"","raw_rating":"0","raw_categories":"Large,VINTAGES"},{"image":"<a style='display: block; z-index: initial;' class='pfw-lightcase' href='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2019\/02\/5847-vas-tulipa-3.jpg'><img style='z-index: -1;' class='pfw-product-image' src='https:\/\/oferantichitati.ro\/silverantiques\/wp-content\/uploads\/sites\/28\/2019\/02\/5847-vas-tulipa-3-235x200.jpg'><\/a>","name":"<a class='pfw-product-name-url' target='_blank' href='https:\/\/oferantichitati.ro\/silverantiques\/product\/bowl-on-short-leg-copy\/'>Tulip bowl&tea-spoon<\/a>","categories":"<a href='https:\/\/oferantichitati.ro\/silverantiques\/product-category\/colectie-decorative\/'>DECORATIVES<\/a>, <a href='https:\/\/oferantichitati.ro\/silverantiques\/product-category\/boluri\/sauce\/'>Sauce<\/a>, <a href='https:\/\/oferantichitati.ro\/silverantiques\/product-category\/vintages\/'>VINTAGES<\/a>","raw_price":"","raw_price_max":"","raw_rating":"0","raw_categories":"DECORATIVES,Sauce,VINTAGES"}], [{"title":"Image","data":"image"},{"title":"Product Name","data":"name"},{"title":"Categories","data":"categories"},{"title":"raw_price","data":"raw_price","visible":false},{"title":"raw_price_max","data":"raw_price_max","visible":false},{"title":"raw_rating","data":"raw_rating","visible":false},{"title":"raw_categories","data":"raw_categories","visible":false}], [{"orderable":false,"responsivePriority":"1","targets":0,"className":"pfw-cell-image"},{"orderable":false,"responsivePriority":"1","targets":1,"className":"pfw-cell-name"},{"orderable":false,"responsivePriority":"1","targets":2,"className":"pfw-cell-categories"}], '', false)   }); })(jQuery)</script><script>

    function pfw_init_table(tableID, tableData, tableColumns, columnDefs, filterString, hasCheckbox)
    {
        console.log('columndefs are ', columnDefs);
        console.log('columns are', tableColumns);
        console.log('table data e', tableData);
        //save the current table to the global array of tables
        pfw_tables[tableID + '_wrapper'] = jQuery(tableID).DataTable({
            data: tableData,
            columns: tableColumns,
            dom: '<"pfw-top"l<"pfw-filters">f>r<"pfw-table-wrapper"t><"pfw-bottom"ip><"clear"><"pfw-bulk-add">',
            responsive: { details: { display: jQuery.fn.dataTable.Responsive.display.childRow } },
            columnDefs: columnDefs,
            language: {
                lengthMenu: "Show _MENU_"
            }
        });

        let category_column_index = 0;
        let rating_column_index = 0;
        let price_column_index = 0;

        console.log('table data is: ', tableData);

        for (let i = 0; i < tableColumns.length; i++)
        {
            if (tableColumns[i].data === 'raw_categories')
                category_column_index = i;
            else if (tableColumns[i].data === 'raw_rating')
                rating_column_index = i;
            else if (tableColumns[i].data === 'raw_price')
                price_column_index = i;
        }


        jQuery.fn.dataTable.ext.search.push(
            function(settings, data, dataIndex){
                let min_price = (jQuery(tableID + '_wrapper .pfw-filters .pfw-price-greater-than').val());
                let max_price = (jQuery(tableID + '_wrapper .pfw-filters .pfw-price-less-than').val());
                let min_rating = (jQuery(tableID + '_wrapper .pfw-filters .pfw-rating-filter').val());
                let selected_categories = jQuery(tableID + '_wrapper .pfw-filters .pfw-filter-categories select').val();

                console.log(data);
                //get data from the column
                let price = parseInt(data[price_column_index]);
                let rating = parseInt(data[rating_column_index]);
                let categories = data[category_column_index].split(",");

                let match_price = true;
                let match_rating = true;
                let match_category = true;

                if (typeof min_price !== 'undefined' && typeof max_price !== 'undefined')
                {
                    if ( min_price !== '' &&  max_price !== '')
                    {
                        console.log('min and max price are set');
                        match_price = price >= parseInt(min_price) && price <= parseInt(max_price);
                    }
                    else if( min_price !== '')
                    {
                        console.log('only min price is set');
                        match_price = price >= parseInt(min_price);
                    }
                    else if ( max_price !== '')
                    {

                        match_price = price <= parseInt(max_price);
                    }
                }



                if (typeof min_rating !== 'undefined' && min_rating !== '')
                    match_rating = rating >= min_rating;

                if (typeof selected_categories !== 'undefined' && selected_categories != null && selected_categories.length > 0)
                {
                    match_category = _.intersection(selected_categories, categories).length > 0;
                }


                return (match_rating && match_category && match_price);

            }
        );

        jQuery(function(){
            jQuery(tableID + '_wrapper .pfw-filters').html(decodeURIComponent(filterString));
            if (hasCheckbox)
                jQuery(tableID + '_wrapper .pfw-bulk-add').html('<button class="pfw-bulk-add-button">Add selected products to cart</button>');

        });

    }

</script>
{"id":2134,"date":"2019-05-31T07:47:34","date_gmt":"2019-05-31T05:47:34","guid":{"rendered":"https:\/\/oferantichitati.ro\/silverantiques\/?page_id=2134"},"modified":"2019-06-02T07:44:42","modified_gmt":"2019-06-02T05:44:42","slug":"vintages","status":"publish","type":"page","link":"https:\/\/oferantichitati.ro\/silverantiques\/vintages\/","title":{"rendered":"VINTAGES"},"content":{"rendered":"\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/oferantichitati.ro\/silverantiques\/wp-json\/wp\/v2\/pages\/2134"}],"collection":[{"href":"https:\/\/oferantichitati.ro\/silverantiques\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oferantichitati.ro\/silverantiques\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oferantichitati.ro\/silverantiques\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oferantichitati.ro\/silverantiques\/wp-json\/wp\/v2\/comments?post=2134"}],"version-history":[{"count":2,"href":"https:\/\/oferantichitati.ro\/silverantiques\/wp-json\/wp\/v2\/pages\/2134\/revisions"}],"predecessor-version":[{"id":2162,"href":"https:\/\/oferantichitati.ro\/silverantiques\/wp-json\/wp\/v2\/pages\/2134\/revisions\/2162"}],"wp:attachment":[{"href":"https:\/\/oferantichitati.ro\/silverantiques\/wp-json\/wp\/v2\/media?parent=2134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}