How to override the order page template for buyers

The Templates for the order & orders page are not working
well, this is not entirely true because they do work, but only for vendors
for regular accounts, the template does not change
also, the orders page should change the orders page and not the vendor order received page
right, not if I edit the orders page, it changes this page account/vendor/orders/
but it needs to change this page my-account/orders/

The single order page needs to be updated both for the user and the vendor

Steps to reproduce

Single Order Template

  1. Create a template for order (a single order template)
  2. Go to the single order page as a regular user my-account/view-order/1234/.
  3. Go to the single order page as a vendor account/vendor/orders/1073/.

Orders Template

  1. Create a template for orders
  2. go to the orders page as a regular user my-account/orders/
  3. go to the orders page as a vendor account/vendor/orders/

Actual result

The pages are mixed up; only vendor pages get updated with the template changes, not the user pages.

Expected result

The template needs to work both for the vendor and the user
Also, the orders received profile section needs a different template Feature Requests marketplace

Extra details

This looks like it’s related to WooCommers, the my-account part of the URL

I think not bug, its handled by different plugin,
orders by hivepress and placed order by woocommerce,
it should work if you using woocommerce hook not hivepress

1 Like

I need to customize the pages for WooCommerce?

Hi, I am also having this difficulty in understanding the requirement to amend the user order page and placed orders under, I guess, the WooCommerce Plugin as opposed to teh Hivepress Templates?

If someone is able to confirm that would be great thank you.

Hi, you need to use code snippets to make your page customizable
In order to do that, you need to know PHP
Here are some resources that might help you:

1 Like

Yes, sorry for the confusion, HivePress basically adds multi-vendor features to WooCommerce so it adds vendor-specific order pages only. Buyer pages are already implemented by WooCommerce, as far as I know they have no Templates feature (at least for the block editor), but there are numerous resources and code snippets for customizing their order pages.

2 Likes

My main issue was that the HivePress multi-vendor features are at the bottom of the page so I used Javascript to update them

jQuery(document).ready(function($){
    // Check if both elements exist
    if ($('.hp-order__actions--primary').length && $('.woocommerce-order-details').length) {
        // Move the .hp-order__actions--primary element before .woocommerce-order-details
        $('.hp-order__actions--primary').insertBefore('.woocommerce-order-details');
    }
});
1 Like

Thanks for sharing the solution!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.