H
H
hypero2021-02-15 18:21:54
WooCommerce
hypero, 2021-02-15 18:21:54

How to move woocommerce sort form?

Hi all.
I'm trying to transfer the WC sort form to the widget with the code:

<form class="woocommerce-ordering" method="get">
    <select name="orderby" class="orderby" aria-label="<?php esc_attr_e( 'Shop order', 'woocommerce' ); ?>">
        <?php foreach ( $catalog_orderby_options as $id => $name ) : ?>
            <option value="<?php echo esc_attr( $id ); ?>" <?php selected( $orderby, $id ); ?>><?php echo esc_html( $name ); ?></option>
        <?php endforeach; ?>
    </select>
    <input type="hidden" name="paged" value="1" />
    <?php wc_query_string_form_fields( null, array( 'orderby', 'submit', 'paged', 'product-page' ) ); ?>
</form>

but result such: It is
602a916680f53590016833.png

necessary to transfer sorting to a widget. How can this be done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hypero, 2021-02-16
@hypero

up

R
Rsa97, 2017-09-28
@Sashjkeee

No 'Access-Control-Allow-Origin' header is present on the requested resource.

Cross domain request failed. The browser saw the Access-Control-Allow-Origin header in the response and gave an error.
Make a request through your backend.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question