• Resolved mastercavid

    (@mastercavid)


    Hi, I converted my default woocommerce dropdown sorting to list style, How can I add support to this code your plugin ajax function?

    <div class="wrapper-dropdown">
        <ul class="dropdown">
            <?php
                $catalog_orderby = apply_filters( 'woocommerce_catalog_orderby', array(
            
                'popularity' => __( 'Populyarlar', 'woocommerce' ),
            
                'date'       => __( '?n yenil?ri', 'woocommerce' ),
            
                'price'      => __( 'Ucuzdan bahal?ya', 'woocommerce' ),
            
                'price-desc' => __( 'Bahal?dan ucuza', 'woocommerce' )
            ) );
            
            if ( get_option( 'woocommerce_enable_review_rating' ) == 'no' )
                unset( $catalog_orderby['rating'] );
            
            foreach ( $catalog_orderby as $id => $name )
                echo '<li><a href="' . get_permalink( woocommerce_get_page_id( 'shop' ) ) . '?orderby=' . $id . '" >' . esc_attr( $name ) . '</a></li>';
            ?>
        </ul>
    </div>
Viewing 1 replies (of 1 total)
  • Hello

    Your code will not work with the filter at all. These links will always reset your search query.

    How can I add support to this code your plugin ajax function? – this function works with sorting:

        jQuery('form.woocommerce-ordering select.orderby').life('change', function () {
            /* woo3.3 */
            if(!jQuery("#is_woo_shortcode").length){
                woof_current_values.orderby = jQuery(this).val();
                woof_ajax_page_num = 1;
                woof_submit_link(woof_get_submit_link(),0);
                return false;
            }
            /* +++ */
        });
Viewing 1 replies (of 1 total)
  • The topic ‘Ajax for custom code’ is closed to new replies.