Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1034047

    Hi,
    Can you help me move related products? I am not satisfied with the woocommerce standard “related products” function so I want to remove that and replace it with the plugin “woo related products”. At the moment “woo related products” are placed under the sidebar and I want that moved up where the standard “related products” is.
    I do hope this makes sence.

    #1034427

    Hey ditteditte,

    Could you post a link so that we can see the actual results you are getting please?

    Best regards,
    Rikard

    #1034467
    #1034685

    Hi,

    Thanks for that, how exactly is the plugin adding the content? You should be able to remove the regular content if you follow this: https://docs.woocommerce.com/document/remove-related-posts-output/

    Best regards,
    Rikard

    #1034709

    Thank you. The plugin is adding the related products in the bottom om the page underneath the sidebar and I want that moved up underneath the product summary where the old related products was. Does that make sence?

    #1036002

    Hi,

    You should ask the plugin author for the actual hook/function that the plugin is using to render the related products and then remove it with the “remove_action” function. You can then use the plugin function back on another hook, or adjust the priority, to move the related post section wherever you like.

    This one removes the default woocommerce related products section:

    // https://docs.woocommerce.com/document/remove-related-posts-output/

    Best regards,
    Ismael

    #1036298

    Can you help me do that in the right way?

    To move the old related products function I used this code (and it worked perfectly):
    ______________________________
    add_action( ‘init’, ‘enfold_customization_woocommerce_related’ );
    function enfold_customization_woocommerce_related() {
    remove_action( ‘woocommerce_after_single_product_summary’, ‘avia_woocommerce_output_related_products’, 20);
    add_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_related_products’, 2);
    }
    ______________________________
    What the plugin auhtor write is:
    ______________________________
    To remove related products block you can use
    remove_action(‘woocommerce_after_single_product’, ‘wrprrdisplay’);
    in your theme’s function.php file.

    If you want to add it again you can do something like this
    add_action(‘woocommerce_after_single_product’, ‘wrprrdisplay’, 55);
    or add_action(‘ANY-OTHER-HOOK’, ‘wrprrdisplay’, PRIORITY);
    ______________________________

    But i can’t seem to get it right. It is like something is missing.

    #1036879

    Hi,

    Put that inside the previous init hook callback “enfold_customization_woocommerce_related” along with the previous modifications.

    remove_action('woocommerce_after_single_product', 'wrprrdisplay');
    add_action('woocommerce_after_single_product', 'wrprrdisplay', 20);
    

    Best regards,
    Ismael

    #1036978

    I added this to my function.php file:

    add_action( ‘init’, ‘enfold_customization_woocommerce_related’ );
    function enfold_customization_woocommerce_related() {
    remove_action(‘woocommerce_after_single_product’, ‘wrprrdisplay’);
    add_action(‘woocommerce_after_single_product’, ‘wrprrdisplay’, 20);
    }

    But it is still placed underneath the sidebar where no one will ever see it.

    #1037047

    Hi,

    Replace “woocommerce_after_single_product” with “woocommerce_after_single_product_summary” and play around with the priority value.

    Best regards,
    Ismael

    #1039011

    Hi,
    I tried this with different priority values, but nothing happens.

    add_action( ‘init’, ‘enfold_customization_woocommerce_related’ );
    function enfold_customization_woocommerce_related() {
    remove_action(‘woocommerce_after_single_product_summary’, ‘wrprrdisplay’);
    add_action(‘woocommerce_after_single_product_summary’, ‘wrprrdisplay’, 20);
    }

    #1040096

    Hi,

    Thanks for the update. This should work:

    add_action( 'init', 'enfold_customization_woocommerce_related' );
    function enfold_customization_woocommerce_related() {
        remove_action('woocommerce_after_single_product', 'wrprrdisplay');
        add_action('woocommerce_after_single_product_summary', 'wrprrdisplay', 20);
    }
    

    Again, you can adjust the priority value. If it doesn’t work, try this:

    add_action( 'init', 'enfold_customization_woocommerce_related' );
    function enfold_customization_woocommerce_related() {
        remove_action('woocommerce_after_single_product', 'wrprrdisplay');
        add_action('woocommerce_after_single_product_title', 'wrprrdisplay', 20);
    }
    

    Best regards,
    Ismael

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