soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
314 stars 29 forks source link

Woocommerce "Product Archive" page overrides page template settings. #3479

Open pad52 opened 10 months ago

pad52 commented 10 months ago

Describe the bug Page template setting (Inside the WP Edit Page screen) works for every page except the one specified in Woocommerce Shop page settings (under Woocommerce -> Settings -> Products -> Shop page).

In case I wish to use a different template for product category archive and shop archive I cannot....

A link to a Sandbox site where the bug has been reproduced: https://oxygen-qysr7ldac3wwl.oxygen-demo.qsandbox.org/shop/

Workaround

  1. Setting a fake shop page in Woocommerce Settings
  2. Catch every redirect to the shop page made by Woocommerce providing the "real" shop page

add_filter( 'woocommerce_return_to_shop_redirect', 'custom_return_to_shop_redirect' );

function custom_return_to_shop_redirect( $redirect ) {
   $redirect = 'https://<LINK TO THE REAL SHOP PAGE>';
    return $redirect;
}