We have enabled “Custom Sorting” but the drop down menu simply isn’t there.
Additionally, we have enabled “Enable Filters feature” and the table we can see in the documentation pdf isn’t showing.
Lastly, the search bar seems to be too small and the word “Search” doesn’t show up that nicely.
How can we solve these issues?
Thank you!
]]>I am attaching the code to create a custom sort.
/* Sort criteria with attribute */
add_filter('woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args');
function custom_woocommerce_get_catalog_ordering_args( $args ) {
global $wp_query;
if (isset($_GET['orderby'])) {
switch ($_GET['orderby']) :
case 'pa_razmer-sazhencza' :
$args['order'] = 'ASC';
$args['meta_key'] = 'pa_razmer-sazhencza';
$args['orderby'] = 'meta_value';
break;
endswitch;
}
return $args;
}
/* Adding a sorting method to the dropdown list */
add_filter('woocommerce_catalog_orderby', 'custom_woocommerce_catalog_orderby');
function custom_woocommerce_catalog_orderby( $sortby ) {
$sortby['pa_razmer-sazhencza'] = 'По высоте';
return $sortby;
}
/* Saving Attributes as Metadata*/
add_action( 'save_post', 'save_woocommerce_attr_to_meta' );
function save_woocommerce_attr_to_meta( $post_id ) {
foreach( $_REQUEST['attribute_names'] as $index => $value ) {
update_post_meta( $post_id, $value, $_REQUEST['attribute_values'][$index] );
}
}
]]>Thanks for your friendly Help, S.
]]>I already know how to sort products on the backoffice by drag’n’drop, so when I sort products on the “All clothing” category they show the way I sorted them. If I try to sort trousers in a different way on the parented category “Trousers” they rearrange the way they showed previously on the main category “All clothing”, and so on.
I’ve also tried to order with numbers inside every product, but I can’t achieve different sortings on products which belong to multiple categories.
Any thoughts on this?
Many thanks.
Filipe
Looking to hopefully draw from the joint knowledge here with a random query,
Does anyone know if it might be possible to custom sort within the woocommerce basket? Ideally, a drag and drop style where a user can reorder where an item sits in the basket.
As a standard, these are ordered by the added time. However, we use woocommerce to build wishlist style PDF documents. We use a pdf catalog plugin that generates a document on the submission of a woocommerce order.
These are created by clients and submitted to us but also we create them inhouse and send them to clients. Our team want to be able to reorder the contents of the basket to directly affect the order of the created catalog. They would also want to be able to add text line items to the basket that can be used as a header in the document (might be going too far with that request).
Does anyone know if this is possible or of any plugin that may do this?
thanks in advance
]]>