• I’m having problems on the wishlist just by adding a product to the list. When I remove the products from the list the page becomes normal. Confirm image below. How to solve? I’ve already reviewed all my template, deactivated pluins, put w3 super exception in cache and nothing worked.

    Exemplo 1
    Without any added product

    Exemplo 2
    With product in the list

    Tks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi amandanoronha

    This really seems a cahce problem, as the only difference between wishlist loaded by default page loading, and wishlist returned after “Remove item” ajax call, is that the latter cames from a non cached request (admin-ajax.php is never cached by default)

    Maybe cache exceptions are not actually effecting your wishlist page; could you please check that slug used in exceptions (usually wishlist/) matches your page slug?

    Besides, could you please try to purge cache for wishlist page, to see if the correct amount of items is displayed?

    Please, let me know
    Have a nice day

    Thread Starter Amanda Noronha Araujo

    (@amandanoronha)

    OK tks! I will notify you as soon as possible

    try to modify the query at line 554 of wp-content/plugins/yith-woocommerce-wishlist/includes/class.yith-wcwl.php

    FIND

     $sql = "SELECT *
             FROM <code>{$wpdb->yith_wcwl_items}</code> AS i
             LEFT JOIN {$wpdb->yith_wcwl_wishlists} AS l ON l.<code>ID</code> = i.<code>wishlist_id</code>
             INNER JOIN {$wpdb->posts} AS p ON p.ID = i.prod_id
             INNER JOIN {$wpdb->postmeta} AS pm ON pm.post_id = p.ID
             WHERE 1 AND p.post_type = %s AND p.post_status = %s AND pm.meta_key = %s AND pm.meta_value = %s";

    CHANGE TO

    $sql = "SELECT *
             FROM <code>{$wpdb->yith_wcwl_items}</code> AS i
             LEFT JOIN {$wpdb->yith_wcwl_wishlists} AS l ON l.<code>ID</code> = i.<code>wishlist_id</code>
             INNER JOIN {$wpdb->posts} AS p ON p.ID = i.prod_id
             INNER JOIN {$wpdb->postmeta} AS pm ON pm.post_id = p.ID
             WHERE 1 AND p.post_type = %s AND p.post_status = %s ";

    AND after that change this array

    $sql_args = array(
       'product',
       'publish'//,
       // '_visibility',
       // 'visible'
    );
    Thread Starter Amanda Noronha Araujo

    (@amandanoronha)

    @yithemes cache exceptions currently

    Never minify the following pages:
    wishlist/*

    Never cache the following pages:
    wp-.*\.php
    index\.php
    wishlist/*
    wishlist

    Rejected cookies:
    wptouch_switch_toggle
    yith_wcwl_products

    And the url is / wishlist

    Thread Starter Amanda Noronha Araujo

    (@amandanoronha)

    @danfox I did not find this function in the file mentioned

    Thread Starter Amanda Noronha Araujo

    (@amandanoronha)

    @danfox Now I found it! I made the modifications plus the problem continues

    @amandanoronha

    the modification in my previous post was for the logged users wishlist.
    For the not logged users use this modification:

    In the same file of above:
    wp-content/plugins/yith-woocommerce-wishlist/includes/class.yith-wcwl.php
    find the recurrence of:

    $existing_products = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} AS p LEFT JOIN {$wpdb->postmeta} AS pm ON p.ID = pm.post_id WHERE post_type = %s AND post_status = %s AND pm.meta_key = %s AND pm.meta_value = %s", array( 'product', 'publish', '_visibility', 'visible' ) ) );

    and change it to:

    $existing_products = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} AS p LEFT JOIN {$wpdb->postmeta} AS pm ON p.ID = pm.post_id WHERE post_type = %s AND post_status = %s", array( 'product', 'publish' ) ) );

    • This reply was modified 7 years, 9 months ago by danfox.
    • This reply was modified 7 years, 9 months ago by danfox.
    • This reply was modified 7 years, 9 months ago by danfox.
    • This reply was modified 7 years, 9 months ago by danfox.
    Thread Starter Amanda Noronha Araujo

    (@amandanoronha)

    Thank you @danfox! I’m going to try these changes and I’ll reply here if it works.

    @amandanoronha say me please … it works?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Problems on the wishlist page just by adding a product to the list’ is closed to new replies.