Home Forums Space themes support forum Woocommerce Product Recommendation plugin conflict

Woocommerce Product Recommendation plugin conflict

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #683253

    patrik.varga
    Participant

    Hi!

    I want to use the Woocommerce product recommendation plugin with Hitek Theme.
    In incognito mode, I just can see a big white space in public side (signed-in admin mode, I can see in public side.)

    I asked 3 Ai chat, and them said same. The trigger for the problem is the product recommendation plugin, but the error itself is in the Hitek template (related to Elementor).

    I sent the debug log in private content.

    Thanks your support, time and help!

    #683255

    patrik.varga
    Participant

    I copied another 2 (maybe) related problem in private content. 🙂

    #683268

    Luke Nielsen
    Keymaster

    Hello,

    I sent it to the developer’s team. As soon as I receive an answer, I will let you know.

    Thank you for your time and patience.

    Kind Regards

    #683272

    patrik.varga
    Participant

    Thanks Luke, I’m waiting for the solution.

    #683554

    Luke Nielsen
    Keymaster

    Hello,

    1. Product Recommendation plugin visibility can be resolved by creating a preset for single product in theme settings – https://monosnap.com/file/GnF6t7pGd06uuLnZV3zj73VoK47jne and disabling the Theme settings->Product archive->Layout->Animation on view option only for single product – https://monosnap.com/file/iG9s0inZeg4N0wHjNidziDJlUdhPbQ

    2. PHP warnings are caused by the Recommendation plugin, please contact their support

    Kind Regards

    #683576

    patrik.varga
    Participant

    Hi Luke!

    Thanks for your reply.

    I globally turned off the animation, and yes, its working.

    But I have another problem, what I cant solve.

    I have to use a custom javasrcipt for better design, what is change the xts-row-lg-4 to xts-row-lg5 in desktop view, because the product recommendation plugin is using inherit source than product archive loop product count.

    In logged-in admin mode, The snippet is running, I can see in single product page 5 columns product listing (product recommendation)
    In Incognito mode, using the default theme option 4 columns solution.

    I tried out that in theme option I made a single product page preset and set the product archive loop 5 columns, but in incognito mode render 4 columns in single product page.

    Custom Javascript in Fluent snippet:
    document.addEventListener(‘DOMContentLoaded’, function() {
    // Mindkét hely: before_tabs és after_tabs
    var targets = document.querySelectorAll(
    ‘.wc-prl-recommendations.wc-prl-location-after_tabs.wc-prl-page-product_details #main_loop, ‘ +
    ‘.wc-prl-recommendations.wc-prl-location-before_tabs.wc-prl-page-product_details #main_loop’
    );

    targets.forEach(function(target) {
    target.classList.remove(‘xts-row-lg-4’);
    target.classList.add(‘xts-row-lg-5’);
    });
    });

    Attachments:
    You must be logged in to view attached files.
    #683610

    patrik.varga
    Participant

    I have found the problem and solution too for the recommendation 4col vs 5 col JS snippet.

    the problem was, the recommendation plugin in NON-ADMIN using ajax loading. So I have to rewrite the snippet code.

    Here is the modified snippet for the community.
    Its working only in single product page!

    (function() {
    // Segédfüggvény: osztály módosítása
    function updateCols() {
    var targets = document.querySelectorAll(
    ‘.wc-prl-recommendations.wc-prl-location-after_tabs.wc-prl-page-product_details #main_loop, ‘ +
    ‘.wc-prl-recommendations.wc-prl-location-before_tabs.wc-prl-page-product_details #main_loop’
    );

    if (!targets.length) return false;

    targets.forEach(function(target) {
    if (target.classList.contains(‘xts-row-lg-4’)) {
    target.classList.remove(‘xts-row-lg-4’);
    target.classList.add(‘xts-row-lg-5’);
    }
    });

    return true;
    }

    // Csak akkor fusson, ha single product page-en vagyunk
    if (!document.body.classList.contains(‘single-product’)) return;

    // Első próbálkozás DOMContentLoaded-kor
    document.addEventListener(‘DOMContentLoaded’, function() {
    if (updateCols()) return; // ha már most sikerült, nem figyelünk tovább

    // Ha nem volt ott a tartalom, figyeljĂĽk a DOM-ot, amĂ­g meg nem jelenik
    var observer = new MutationObserver(function() {
    if (updateCols()) {
    observer.disconnect(); // ha sikerült, leállítjuk a figyelést
    }
    });

    observer.observe(document.body, { childList: true, subtree: true });
    });
    })();

Viewing 7 posts - 1 through 7 (of 7 total)