WordPress.org

Support

Support » Plugins and Hacks » Break up Related Products from Product Data Tabs

Break up Related Products from Product Data Tabs

  • I’m trying to modify the markup so the single product page meets the desired design.

    I want to break up the Related Products from the Product Data Tabs.
    Both are being called -one after another- with the woocommerce_after_single_product_summary hook.

    Basically, I want to output each one wherever I need it and wrap it with whatever I want to.

    Is there any way to call them separetely?

    Any help will be very much appreciated.

    http://wordpress.org/extend/plugins/woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author James Koster
    Participant

    @jameskoster

    Hi there,

    Not really sure what you mean. They are called separately. If you want to move one component then unhook it from woocommerce_after_single_product_summary then hook it back into a more appropriate action. You can see a list of template hooks in woocommerce-hooks.php.

    To edit markup you will need to edit the template files directly. If you edit a template, please be sure to copy it to your theme so you’re safe when you upgrade. You can read about how to do that here; http://docs.woothemes.com/document/template-structure/

    Thanks, Jay

    Thanks very much for your help Jay, can you help me with a little sample code on how to unhook and hook it back again?

    Maybe that’s my problem, I have tried something like this with no success:

    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );

    … and then call it back again:

    do_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );

    Roy Ho
    Member

    @splashingpixelscom

    @ameraz – you need to use add_action() and add it to the hook you want it to show.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Break up Related Products from Product Data Tabs’ is closed to new replies.