Woocommerce filter by floor dimensions (width*length) in products page?WooCommerce - get category for product pageWordpress query - Order by meta-field valueWordPress WP_Query: Display custom post type based on custom meta value, and also order on another custom meta valueAdd In Text/HTML After Woocommerce Product Page Descriptionhow woocommerce product get order by product tagHow to display all orders for a single product showing the most recent first? WoocommerceWoocommerce override Product Price with custom value on cart and checkoutChange the Product dimensions order in WooCommerce single product pagesRandomize WooCommerce “Shop By Category”WooCommerce order variation products by price

How quality assurance engineers test calculations?

Why weren't bootable game disks ever a thing on the IBM PC?

The three greedy pirates

How do we handle pauses in a dialogue?

What would +1/+2/+3 items be called in game?

Can I play a mimic PC?

What's the point of having a RAID 1 configuration over incremental backups to a secondary drive?

Can i use larger/smaller circular saw blades on my circular / plunge / table / miter saw?

Party going through airport security at separate times?

Reverse dots and boxes

Does a wizard need their hands free in order to cause their familiar from the Find Familiar spell to reappear?

What is the correct parsing of お高くとまる?

Why did Harry Potter get a bedroom?

How can a dictatorship government be beneficial to a dictator in a post-scarcity society?

Having decision making power over someone's assets

Addressing unnecessary daily meetings with manager?

Data Encryption by Application vs Data Encryption in Database

What are the original Russian words for a prostitute?

What attributes and how big would a sea creature(s) need to be able to tow a ship?

How to drill holes in 3/8" steel plates?

LED glows slightly during soldering

Integer Lists of Noah

Why does the Antonov AN-225 not have any winglets?

Misrepresented my work history



Woocommerce filter by floor dimensions (width*length) in products page?


WooCommerce - get category for product pageWordpress query - Order by meta-field valueWordPress WP_Query: Display custom post type based on custom meta value, and also order on another custom meta valueAdd In Text/HTML After Woocommerce Product Page Descriptionhow woocommerce product get order by product tagHow to display all orders for a single product showing the most recent first? WoocommerceWoocommerce override Product Price with custom value on cart and checkoutChange the Product dimensions order in WooCommerce single product pagesRandomize WooCommerce “Shop By Category”WooCommerce order variation products by price






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm trying to create a custom filter for product dimensions in Woocommerce products page. I can't find a way to do any math to accomplish filtering based on floor dimensions (width*length).



function woocommerce_catalog_orderby( $orderby ) 

$orderby['heaviest'] = __( 'Heaviest first', 'woocommerce' );
$orderby['lightest'] = __( 'Lightest first', 'woocommerce' );
$orderby['biggest'] = __( 'Biggest first', 'woocommerce' );
return $orderby;

add_filter( "woocommerce_catalog_orderby", "woocommerce_catalog_orderby", 20 );
function woocommerce_get_catalog_ordering_args( $args )
$orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) );

if ( 'heaviest' == $orderby_value )
$args['meta_key'] = '_weight';
$args['orderby'] = 'meta_value_num';
$args['order'] = 'DESC';


if ( 'lightest' == $orderby_value )
$args['meta_key'] = '_weight';
$args['orderby'] = 'meta_value_num';
$args['order'] = 'ASC';


if ( 'biggest' == $orderby_value )
$math='_length' * '_width';

$args['meta_key'] = $math;
$args['orderby'] = 'meta_value_num';
$args['order'] = 'DESC';


return $args;

add_filter( 'woocommerce_get_catalog_ordering_args', 'woocommerce_get_catalog_ordering_args', 20 );









share|improve this question






















  • This is not possible this way… You should need to save on database for each product a custom field (custom meta data) which value is the result of from product length x product width.

    – LoicTheAztec
    Mar 26 at 1:51

















0















I'm trying to create a custom filter for product dimensions in Woocommerce products page. I can't find a way to do any math to accomplish filtering based on floor dimensions (width*length).



function woocommerce_catalog_orderby( $orderby ) 

$orderby['heaviest'] = __( 'Heaviest first', 'woocommerce' );
$orderby['lightest'] = __( 'Lightest first', 'woocommerce' );
$orderby['biggest'] = __( 'Biggest first', 'woocommerce' );
return $orderby;

add_filter( "woocommerce_catalog_orderby", "woocommerce_catalog_orderby", 20 );
function woocommerce_get_catalog_ordering_args( $args )
$orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) );

if ( 'heaviest' == $orderby_value )
$args['meta_key'] = '_weight';
$args['orderby'] = 'meta_value_num';
$args['order'] = 'DESC';


if ( 'lightest' == $orderby_value )
$args['meta_key'] = '_weight';
$args['orderby'] = 'meta_value_num';
$args['order'] = 'ASC';


if ( 'biggest' == $orderby_value )
$math='_length' * '_width';

$args['meta_key'] = $math;
$args['orderby'] = 'meta_value_num';
$args['order'] = 'DESC';


return $args;

add_filter( 'woocommerce_get_catalog_ordering_args', 'woocommerce_get_catalog_ordering_args', 20 );









share|improve this question






















  • This is not possible this way… You should need to save on database for each product a custom field (custom meta data) which value is the result of from product length x product width.

    – LoicTheAztec
    Mar 26 at 1:51













0












0








0








I'm trying to create a custom filter for product dimensions in Woocommerce products page. I can't find a way to do any math to accomplish filtering based on floor dimensions (width*length).



function woocommerce_catalog_orderby( $orderby ) 

$orderby['heaviest'] = __( 'Heaviest first', 'woocommerce' );
$orderby['lightest'] = __( 'Lightest first', 'woocommerce' );
$orderby['biggest'] = __( 'Biggest first', 'woocommerce' );
return $orderby;

add_filter( "woocommerce_catalog_orderby", "woocommerce_catalog_orderby", 20 );
function woocommerce_get_catalog_ordering_args( $args )
$orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) );

if ( 'heaviest' == $orderby_value )
$args['meta_key'] = '_weight';
$args['orderby'] = 'meta_value_num';
$args['order'] = 'DESC';


if ( 'lightest' == $orderby_value )
$args['meta_key'] = '_weight';
$args['orderby'] = 'meta_value_num';
$args['order'] = 'ASC';


if ( 'biggest' == $orderby_value )
$math='_length' * '_width';

$args['meta_key'] = $math;
$args['orderby'] = 'meta_value_num';
$args['order'] = 'DESC';


return $args;

add_filter( 'woocommerce_get_catalog_ordering_args', 'woocommerce_get_catalog_ordering_args', 20 );









share|improve this question














I'm trying to create a custom filter for product dimensions in Woocommerce products page. I can't find a way to do any math to accomplish filtering based on floor dimensions (width*length).



function woocommerce_catalog_orderby( $orderby ) 

$orderby['heaviest'] = __( 'Heaviest first', 'woocommerce' );
$orderby['lightest'] = __( 'Lightest first', 'woocommerce' );
$orderby['biggest'] = __( 'Biggest first', 'woocommerce' );
return $orderby;

add_filter( "woocommerce_catalog_orderby", "woocommerce_catalog_orderby", 20 );
function woocommerce_get_catalog_ordering_args( $args )
$orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) );

if ( 'heaviest' == $orderby_value )
$args['meta_key'] = '_weight';
$args['orderby'] = 'meta_value_num';
$args['order'] = 'DESC';


if ( 'lightest' == $orderby_value )
$args['meta_key'] = '_weight';
$args['orderby'] = 'meta_value_num';
$args['order'] = 'ASC';


if ( 'biggest' == $orderby_value )
$math='_length' * '_width';

$args['meta_key'] = $math;
$args['orderby'] = 'meta_value_num';
$args['order'] = 'DESC';


return $args;

add_filter( 'woocommerce_get_catalog_ordering_args', 'woocommerce_get_catalog_ordering_args', 20 );






php wordpress woocommerce






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 26 at 0:34









FerallenFerallen

133 bronze badges




133 bronze badges












  • This is not possible this way… You should need to save on database for each product a custom field (custom meta data) which value is the result of from product length x product width.

    – LoicTheAztec
    Mar 26 at 1:51

















  • This is not possible this way… You should need to save on database for each product a custom field (custom meta data) which value is the result of from product length x product width.

    – LoicTheAztec
    Mar 26 at 1:51
















This is not possible this way… You should need to save on database for each product a custom field (custom meta data) which value is the result of from product length x product width.

– LoicTheAztec
Mar 26 at 1:51





This is not possible this way… You should need to save on database for each product a custom field (custom meta data) which value is the result of from product length x product width.

– LoicTheAztec
Mar 26 at 1:51












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55348271%2fwoocommerce-filter-by-floor-dimensions-widthlength-in-products-page%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55348271%2fwoocommerce-filter-by-floor-dimensions-widthlength-in-products-page%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현