Forum Replies Created

Viewing 15 replies - 16 through 30 (of 40 total)
  • Mohammad Javed

    (@digitljaved)

    Hi @brianmcculloh

    Are the server permissions on the files/folders set correctly?

    I would check with the hosting company.

    Thank you,
    Javed

    Thread Starter Mohammad Javed

    (@digitljaved)

    Hi @highprrrr

    This problem has now been resolved. It was problems with the child theme and enqueuing assets.

    Thank you,
    Javed

    Thread Starter Mohammad Javed

    (@digitljaved)

    Okay – I have found the problem, it was with a custom function in the child theme. Now that is fixed, I have noticed another problem, when switching to next month (April) I have to then CTRL + F5 (hard refresh) the page for it to show the calendar working with the events added.

    Any ideas why this is happening, the caching the month view checkbox has not been ticked on the backend?

    • This reply was modified 3 years ago by Yui.
    • This reply was modified 3 years ago by Mohammad Javed. Reason: updating the original post that is no longer required
    Thread Starter Mohammad Javed

    (@digitljaved)

    Thanks, @mujahid158 I will check this out. I’ve moved to another plugin but will test this on a local copy and report back to you.

    Thread Starter Mohammad Javed

    (@digitljaved)

    Hello @aguseo

    An email has been sent to that email address with all the information you have requested.

    Thank you,
    Javed

    How was this resolved?

    Thread Starter Mohammad Javed

    (@digitljaved)

    Any updates on this?

    Can anyone help here?

    Thread Starter Mohammad Javed

    (@digitljaved)

    Hi Ross,

    Thank you for getting back to me so quickly.

    I have applied that workaround and it seems to be working fine now.

    Do we have an ETA on when we can expect a permanent fix to be applied to WooCommerce?

    Thanks,
    Javed

    Thread Starter Mohammad Javed

    (@digitljaved)

    Hi @phillipwoo

    The filtering does not work when I take it out of the functions file.

    It looks like I’ll have to use the snippets you’ve recommended and test the sorting out that way.

    I’ve made a copy of the site and tinkering with that instead of the live website: https://wordpress-281395-925095.cloudwaysapps.com/fuel-tanks/adblue-tanks/adblue-dispensers/

    I’ll let you know how I get on.

    Thread Starter Mohammad Javed

    (@digitljaved)

    Thank you @phillipwoo

    The site is currently using the storefront child theme from Woo.

    Thread Starter Mohammad Javed

    (@digitljaved)

    Hi @phillipwoo

    The tasks for product lookup tables are all logged as complete, so looks like that has gone through fine.

    It looks like the problem is around the custom code that is in the functions file for ordering the products by the capacity that isn’t functioning correctly.

    Which table does WooCommerce use to store the product attributes data?

    Thank you,
    Javed

    Thread Starter Mohammad Javed

    (@digitljaved)

    Hi @phillipwoo

    I don’t think that has fixed the product sorting by capacity in ASC/DESC order. After regenerating the table, and updating all the products in that category, the filtering doesn’t work.

    LINK

    Thread Starter Mohammad Javed

    (@digitljaved)

    Morning @phillipwoo

    Thank you for reaching out to me, much appreciated.

    I’ve now clicked on the “Regenerate” button for Product lookup tables. How will I know that the regeneration has been completed?

    The client currently has under 300 products, so I don’t think it should take that long to regenerate the product lookup tables.

    Do I need to save ALL products once the regeneration has taken place?

    Thank you,
    Javed

    Thread Starter Mohammad Javed

    (@digitljaved)

    Here are the functions for the filtering that is located in setup.php in the functions folder situated in the child theme;

    /* Add sorting by attributes */
    
    /**
     *  Defines the criteria for sorting with options defined in the method below
     */
    add_filter( 'woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args' );
    function custom_woocommerce_get_catalog_ordering_args($args)
    {
        global $wp_query;
    
        if ($_GET['orderby']) {
            $orderby_value = $_GET['orderby'];
        } else {
    
            $term = get_queried_object();
            $children = get_terms($term->taxonomy, array(
                'parent' => $term->term_id,
                'hide_empty' => false
            ));
            if(!$children){
                $orderby_value = apply_filters('woocommerce_default_catalog_orderby', get_option('woocommerce_default_catalog_orderby'));
            }else{
                $orderby_value = ''; // apply_filters('woocommerce_default_catalog_orderby', get_option('woocommerce_default_catalog_orderby'))
            }
        }
    
        $args = null;
        if(array_sum (check_capacity()) > 0){
            if ('pa_capacity_asc' == $orderby_value) {
                $args['orderby'] = 'meta_value_num';
                $args['order'] = 'asc';
                $args['meta_key'] = 'pa_capacity';
            } else if ('pa_capacity_desc' == $orderby_value) {
                $args['orderby'] = 'meta_value_num';
                $args['order'] = 'desc';
                $args['meta_key'] = 'pa_capacity';
            }
        }
    
        return $args;
    }
    
    function check_capacity(){
    
        global $wp_query;
    
        $out = [];
        $curr_cat_id = $wp_query->get_queried_object()->term_id;
        $args = array(
            'post_type' => 'product',
            'posts_per_page' => -1,
            'tax_query' => array(
                'relation' => 'AND',
                array(
                    'taxonomy' => 'product_cat',
                    'field' => 'term_id',
                    'terms' => $curr_cat_id
                )
            ),
        );
        $loop = new WP_Query($args);
        if ($loop->have_posts()): while ($loop->have_posts()): $loop->the_post();
    
            global $product;
            $koostis = array_shift(wc_get_product_terms(get_the_ID(), 'pa_capacity', array('fields' => 'names')));
            $out[get_the_ID()] = $koostis;
    
        endwhile; endif;
        wp_reset_postdata();
    
        return($out);
    
    }
    add_filter( 'woocommerce_default_catalog_orderby_options', 'custom_woocommerce_catalog_orderby' );
    
    /**
     *  Adds the sorting options to dropdown list .. The logic/criteria is in the method above
     */
    add_filter( 'woocommerce_catalog_orderby', 'custom_woocommerce_catalog_orderby' );
    function custom_woocommerce_catalog_orderby( $sortby ) {
        $sortby['pa_capacity_asc'] = 'Sort by Capacity (Asc)';
        $sortby['pa_capacity_desc'] = 'Sort by Capacity (Desc)';
    
        return $sortby;
    }
    
    /**
     *  Save custom attributes as post's meta data as well so that we can use in sorting and searching
     */
    add_action( 'save_post', 'save_woocommerce_attr_to_meta' );
    function save_woocommerce_attr_to_meta( $post_id ) {
        $post_type = get_post_type($post_id);
        // If this isn't a 'product' post, don't update it.
        if ($post_type != 'product')
            return;
    
        // If attribute name and value exist
        if (!empty($_POST['attribute_names']) && !empty($_POST['attribute_values'])) {
            $attribute_names = $_POST['attribute_names'];
            $attribute_values = $_POST['attribute_values'];
    
            // Add post meta data for each attribute
            foreach( $attribute_names as $index => $attribute_name ) {
                update_post_meta( $post_id, $attribute_name, $attribute_values[$index] );
            }
        }
    }

    Have a look at these images: SCREENSHOTS

    The first image shows how the attribute data is being stored in the database with the latest version of WooCommerce & WordPress.

    The second image shows how the attribute USE TO BE stored in the database.

    If you require any further information from me, do let me know.

    Let me know how we can sort this out. Thank you.

    Thread Starter Mohammad Javed

    (@digitljaved)

    WordPress environment information for debugging;

    ### WordPress Environment ###
    
    WordPress address (URL): https://www.tuffa.co.uk
    Site address (URL): https://www.tuffa.co.uk
    WC Version: 3.6.4
    Log Directory Writable: ?
    WP Version: 5.2.2
    WP Multisite: –
    WP Memory Limit: 256 MB
    WP Debug Mode: –
    WP Cron: ?
    Language: en_GB
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache/2.4.10 (Debian)
    PHP Version: 7.2.14-1+0~20190113100657.14+jessie~1.gbpd83c69
    PHP Post Max Size: 10 MB
    PHP Time Limit: 60
    PHP Max Input Vars: 2500
    cURL Version: 7.38.0
    OpenSSL/1.0.1t
    
    SUHOSIN Installed: –
    MySQL Version: ? 5.5.62-0+deb8u1 - We recommend a minimum MySQL version of 5.6. See: WordPress requirements
    Max Upload Size: 10 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Database ###
    
    WC Database Version: 3.6.4
    WC Database Prefix: wp_
    MaxMind GeoIP Database: ?
    Total Database Size: 44.52MB
    Database Data Size: 35.87MB
    Database Index Size: 8.65MB
    wp_woocommerce_sessions: Data: 0.01MB + Index: 0.00MB
    wp_woocommerce_api_keys: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_order_items: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_order_itemmeta: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_tax_rates: Data: 0.00MB + Index: 0.01MB
    wp_woocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_log: Data: 0.00MB + Index: 0.00MB
    wp_commentmeta: Data: 0.02MB + Index: 0.03MB
    wp_comments: Data: 0.08MB + Index: 0.09MB
    wp_links: Data: 0.02MB + Index: 0.02MB
    wp_litespeed_optimizer: Data: 0.00MB + Index: 0.00MB
    wp_nf3_actions: Data: 0.02MB + Index: 0.00MB
    wp_nf3_action_meta: Data: 0.05MB + Index: 0.00MB
    wp_nf3_chunks: Data: 0.02MB + Index: 0.00MB
    wp_nf3_fields: Data: 0.02MB + Index: 0.00MB
    wp_nf3_field_meta: Data: 0.09MB + Index: 0.00MB
    wp_nf3_forms: Data: 0.02MB + Index: 0.00MB
    wp_nf3_form_meta: Data: 0.02MB + Index: 0.00MB
    wp_nf3_objects: Data: 0.02MB + Index: 0.00MB
    wp_nf3_object_meta: Data: 0.02MB + Index: 0.00MB
    wp_nf3_relationships: Data: 0.02MB + Index: 0.00MB
    wp_nf3_upgrades: Data: 0.02MB + Index: 0.00MB
    wp_options: Data: 4.22MB + Index: 0.08MB
    wp_postmeta: Data: 16.52MB + Index: 5.97MB
    wp_posts: Data: 12.52MB + Index: 1.06MB
    wp_redirection_404: Data: 0.69MB + Index: 0.36MB
    wp_redirection_groups: Data: 0.00MB + Index: 0.00MB
    wp_redirection_items: Data: 0.01MB + Index: 0.01MB
    wp_redirection_logs: Data: 0.03MB + Index: 0.02MB
    wp_smush_dir_images: Data: 0.00MB + Index: 0.00MB
    wp_termmeta: Data: 0.08MB + Index: 0.03MB
    wp_terms: Data: 0.05MB + Index: 0.03MB
    wp_termsmeta: Data: 0.00MB + Index: 0.01MB
    wp_term_relationships: Data: 0.16MB + Index: 0.14MB
    wp_term_taxonomy: Data: 0.16MB + Index: 0.03MB
    wp_usermeta: Data: 0.11MB + Index: 0.03MB
    wp_users: Data: 0.02MB + Index: 0.05MB
    wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB
    wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB
    wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB
    wp_wc_download_log: Data: 0.02MB + Index: 0.03MB
    wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB
    wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB
    wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB
    wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB
    wp_wc_product_meta_lookup: Data: 0.05MB + Index: 0.09MB
    wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB
    wp_wfbadleechers: Data: 0.02MB + Index: 0.00MB
    wp_wfblockediplog: Data: 0.02MB + Index: 0.00MB
    wp_wfblocks: Data: 0.02MB + Index: 0.02MB
    wp_wfblocksadv: Data: 0.02MB + Index: 0.00MB
    wp_wfconfig: Data: 0.02MB + Index: 0.00MB
    wp_wfcrawlers: Data: 0.02MB + Index: 0.00MB
    wp_wffilemods: Data: 0.02MB + Index: 0.00MB
    wp_wfhits: Data: 0.02MB + Index: 0.05MB
    wp_wfhoover: Data: 0.02MB + Index: 0.02MB
    wp_wfissues: Data: 0.02MB + Index: 0.00MB
    wp_wfknownfilelist: Data: 0.02MB + Index: 0.00MB
    wp_wfleechers: Data: 0.02MB + Index: 0.00MB
    wp_wflockedout: Data: 0.02MB + Index: 0.00MB
    wp_wflocs: Data: 0.02MB + Index: 0.00MB
    wp_wflogins: Data: 0.02MB + Index: 0.03MB
    wp_wfnet404s: Data: 0.02MB + Index: 0.02MB
    wp_wfnotifications: Data: 0.02MB + Index: 0.00MB
    wp_wfpendingissues: Data: 0.02MB + Index: 0.00MB
    wp_wfreversecache: Data: 0.02MB + Index: 0.00MB
    wp_wfscanners: Data: 0.02MB + Index: 0.00MB
    wp_wfsnipcache: Data: 0.02MB + Index: 0.05MB
    wp_wfstatus: Data: 0.02MB + Index: 0.03MB
    wp_wfthrottlelog: Data: 0.02MB + Index: 0.02MB
    wp_wfvulnscanners: Data: 0.02MB + Index: 0.00MB
    wp_yoast_seo_links: Data: 0.09MB + Index: 0.03MB
    wp_yoast_seo_meta: Data: 0.05MB + Index: 0.05MB
    
    ### Post Type Counts ###
    
    acf-field: 59
    acf-field-group: 4
    attachment: 1845
    custom_css: 1
    faq: 41
    mc4wp-form: 1
    nav_menu_item: 75
    nf_sub: 615
    oembed_cache: 1
    page: 34
    post: 368
    product: 280
    product_variation: 6
    revision: 1865
    scheduled-action: 104
    
    ### Security ###
    
    Secure connection (HTTPS): ?
    Hide errors from visitors: ?
    
    ### Active Plugins (21) ###
    
    Advanced Custom Fields PRO: by Elliot Condon – 5.8.1
    Advanced Custom Fields: by Elliot Condon – 5.8.1
    Categories Images: by Muhammad Said El Zahlan – 2.5.4
    Disable Gutenberg: by Jeff Starr – 1.8.1
    Google Tag Manager for WordPress: by Thomas Geiger – 1.9.2 – Not tested with the active version of WooCommerce
    Filename-based asset cache busting: by Ben Lumley – 1.3
    JivoChat: by JivoChat – 1.3.3
    Mailchimp for WordPress: by ibericode – 4.5.2
    Ninja Forms: by The WP Ninjas – 3.4.16
    Redirection: by John Godley – 4.3.1
    Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 3.1.1
    Simple Custom Post Order: by Colorlib – 2.4.4
    SVG Support: by Benbodhi – 2.3.15
    TAO Schedule Update: by TAO Digital – 1.15
    Tweetlab: by MaGeek Lab – 2.0.2
    Premmerce Permalink Manager for WooCommerce: by premmerce – 2.1.9
    WooCommerce: by Automattic – 3.6.4 – 3.6.5 is available
    WordPress Importer: by wordpressdotorg – 0.6.4
    Yoast SEO: by Team Yoast – 11.4 – Not tested with the active version of WooCommerce
    WP Media Category Management: by DeBAAT  – 1.9.4
    YITH WooCommerce Catalog Mode: by YITH – 1.6.9
    
    ### Inactive Plugins (8) ###
    
    Akismet Anti-Spam: by Automattic – 4.1.2
    Autoptimize: by Frank Goossens (futtta) – 2.5.1
    Category and Taxonomy Meta Fields: by Aftab Husain – 1.0.0
    Lazy Loader: by Florian Brinkmann
    MarcDK – 4.1.0
    
    Smush: by WPMU DEV – 3.2.1
    W3 Total Cache: by Frederick Townes – 0.9.7.5
    WooCommerce Admin: by WooCommerce – 0.14.0
    Wordfence Security: by Wordfence – 7.3.4
    
    ### Settings ###
    
    API Enabled: ?
    Force SSL: –
    Currency: GBP (£)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    
    Connected to WooCommerce.com: –
    
    ### WC Pages ###
    
    Shop base: #4 - /shop/
    Basket: #5 - /cart/
    Checkout: #6 - /checkout/
    My account: #7 - /my-account/
    Terms and conditions: ? Page not set
    
    ### Theme ###
    
    Name: storefront-child
    Version: 2.2.4
    Author URL: https://woocommerce.com/
    Child Theme: ?
    Parent Theme Name: Storefront
    Parent Theme Version: 2.2.4 – 2.5.0 is available
    Parent Theme Author URL: https://woocommerce.com/
    WooCommerce Support: ?
    
    ### Templates ###
    
    Overrides: storefront-child/woocommerce/archive-product.php version 2.0.0 is out of date. The core version is 3.4.0
    storefront-child/woocommerce/global/breadcrumb.php
    storefront-child/woocommerce/loop/orderby.php version 2.2.0 is out of date. The core version is 3.6.0
    storefront-child/woocommerce/single-product/product-attributes.php version 3.1.0 is out of date. The core version is 3.6.0
    storefront-child/woocommerce/single-product/related.php
    storefront-child/woocommerce/single-product/short-description.php version 1.6.4 is out of date. The core version is 3.3.0
    storefront-child/woocommerce/single-product/tabs/tabs.php
    storefront-child/woocommerce/single-product/title.php
    storefront-child/woocommerce/single-product/up-sells.php
    
    Outdated Templates: ?
    					
    					
    						Learn how to update
    
    ### Action Scheduler ###
    
    Complete: 103
    Oldest: 2019-06-17 10:04:06 +0000
    Newest: 2019-06-26 11:29:54 +0000
    
    Pending: 0
    Oldest: –
    Newest: –
    
    Canceled: 1
    Oldest: 2019-06-26 12:29:54 +0000
    Newest: 2019-06-26 12:29:54 +0000
    
    In-progress: 0
    Oldest: –
    Newest: –
    
    Failed: 0
    Oldest: –
    Newest: –
Viewing 15 replies - 16 through 30 (of 40 total)