• Resolved sunfffd

    (@sunfffd)


    Hi,

    I have a site with WPML and i can successfully add a product to wish list,
    however on the same page the button status is not updated when I reload the product page.
    The Ajax results shows empty wishlist. Is there any WPML settings i’m missing?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter sunfffd

    (@sunfffd)

    we found that the SQL from the ajax.php script is not getting any results:

    SELECT
    wp_tinvwl_items.ID, t.element_id AS product_id,
    t2.element_id AS variation_id, wp_tinvwl_items.formdata,wp_tinvwl_items.author,
    wp_tinvwl_items.date,wp_tinvwl_items.quantity,wp_tinvwl_items.price,wp_tinvwl_items.in_stock,
    wp_tinvwl_lists.ID as wishlist_id,
    wp_tinvwl_lists.status as wishlist_status, wp_tinvwl_lists.title as wishlist_title,
    wp_tinvwl_lists.share_key as wishlist_share_key FROM wp_tinvwl_items

    INNER JOIN wp_tinvwl_lists ON wp_tinvwl_items.wishlist_id = wp_tinvwl_lists.ID
    AND wp_tinvwl_lists.type = ‘default’
    LEFT JOIN wp_icl_translations t ON
    wp_tinvwl_items.product_id = t.trid AND t.element_type = ‘post_product’ AND t.language_code = ‘en’
    LEFT JOIN wp_icl_translations t2 ON
    wp_tinvwl_items.variation_id != 0 AND wp_tinvwl_items.variation_id = t2.trid AND t2.element_type = ‘post_product_variation’ AND t2.language_code = ‘en’
    JOIN wp_icl_languages l ON
    (
    t.language_code = l.code OR t2.language_code = l.code
    ) AND l.active = 1 WHERE wp_tinvwl_items.author=’46’ ORDER BY date DESC LIMIT 0,99999;

    Thread Starter sunfffd

    (@sunfffd)

    We found that if we change trid to element_id in the query, the function works

    SELECT wp_tinvwl_items.ID, t.element_id AS product_id, t2.element_id AS variation_id, wp_tinvwl_items.formdata,wp_tinvwl_items.author,wp_tinvwl_items.date,wp_tinvwl_items.quantity,wp_tinvwl_items.price,wp_tinvwl_items.in_stock,wp_tinvwl_lists.ID as wishlist_id, wp_tinvwl_lists.status as wishlist_status, wp_tinvwl_lists.title as wishlist_title, wp_tinvwl_lists.share_key as wishlist_share_key FROM wp_tinvwl_items INNER JOIN wp_tinvwl_lists ON wp_tinvwl_items.wishlist_id = wp_tinvwl_lists.ID AND wp_tinvwl_lists.type = ‘default’LEFT JOIN wp_icl_translations t ON
    wp_tinvwl_items.product_id = t.element_id AND t.element_type = ‘post_product’ AND t.language_code = ‘en’
    LEFT JOIN wp_icl_translations t2 ON
    wp_tinvwl_items.variation_id != 0
    AND wp_tinvwl_items.variation_id = t2.element_id
    AND t2.element_type = ‘post_product_variation’
    AND t2.language_code = ‘en’
    JOIN wp_icl_languages l ON
    (
    t.language_code = l.code OR t2.language_code = l.code
    ) AND l.active = 1 WHERE wp_tinvwl_items.author=’2′ ORDER BY date DESC LIMIT 0,99999;

    Thread Starter sunfffd

    (@sunfffd)

    However if we change the above query, the wishlist in another language does not work.

    In a clean install, the function all works. I guess there are some problems with the element_id and trid.

    Plugin Author templateinvaders

    (@templateinvaders)

    Hi @sunfffd

    Could you share WP admin access to your staging for debugging? You can drop this info via the form on our website.

    Thanks!

    Thread Starter sunfffd

    (@sunfffd)

    Hi @templateinvaders
    Thanks, will do!

    Plugin Author templateinvaders

    (@templateinvaders)

    Hi @sunfffd

    The issue fixed in version 1.21.10

    Thread Starter sunfffd

    (@sunfffd)

    @templateinvaders

    Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Getting product wishlist status with WPML’ is closed to new replies.