• I updated the plugin 1 month ago, but the “Attachment” tab in My Account page still showing page not show attachments display (my-account/wcoa-attachments/)

    or if someone here can share a fix?

    Noted : i can try fix update permalink and repeating install , clear cache but can’t work

    help me please!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter odwnowm

    (@odwnowm)

    help me please! help me please!

    Hello,

    You can fix this problem by editing a query. Please follow these steps:

    1. Open class/class-wcoa-attachment.php file
    2. Around line number 117 there should be this query:

    SELECT attachment.ID AS attachment_id,
           attachment.post_date,
           attachment.post_title,
           attachment_meta.post_id AS order_id,
           attachment.guid,
           user_order.post_author
           FROM %s AS attachment_meta
           JOIN %s AS attachment ON attachment_meta.meta_value = attachment.ID
           JOIN %s AS user_order ON attachment_meta.post_id = user_order.ID
           WHERE attachment_meta.meta_key = '_wcoa_attachment_id' 
           AND attachment.post_type = 'attachment' 
           AND user_order.post_author = %d;

    3. Change it to this:

    SELECT attachment.ID AS attachment_id,
    ? ? ? ? attachment.post_date,
            attachment.post_title,
            attachment_meta.post_id AS order_id,
            attachment.guid,
            attachment.post_author
            FROM %s AS attachment_meta
            JOIN %s AS attachment ON attachment_meta.meta_value = attachment.ID
            JOIN %s AS user_order ON attachment_meta.post_id = user_order.ID
            WHERE attachment_meta.meta_key = '_wcoa_attachment_id'
            AND attachment.post_type = 'attachment'
            AND attachment.post_author = %d;

    The problem has been solved. You can find the solution in the support forum at the top.

    Greetings

    azlewa

    (@azlewa)

    The query above that “fixes the problem” is wrong. Only _customer_user value in wp_postmeta contains the correct user id (and is not the same as post_author). So to fix the query you need another JOIN:

    JOIN wp_postmeta AS user_order_meta ON user_order_meta.post_id = user_order.ID AND user_order_meta.meta_key = '_customer_user'
    WHERE user_order_meta.meta_value = %d

    Plugin Author Dominik

    (@sldesignpl)

    Hello, the mentioned bugs have been fixed in the latest release. Please update the plugin and let me know if the issue still occurs.

    Hello @sldesignpl ,

    The plugin still doesn’t show attachments for the logged in user.

    Regards,
    Arber

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.