Server IP : 172.67.158.161 / Your IP : 18.117.7.212 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/giankuin/www/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/blocks/products/ |
Upload File : |
/** * External dependencies */ import { __ } from '@wordpress/i18n'; import { ToggleControl, SelectControl } from '@wordpress/components'; /** * Internal dependencies */ import './editor.scss'; export const getSharedContentControls = ( attributes, setAttributes ) => { const { contentVisibility } = attributes; return ( <ToggleControl label={ __( 'Show Sorting Dropdown', 'woocommerce' ) } checked={ contentVisibility.orderBy } onChange={ () => setAttributes( { contentVisibility: { ...contentVisibility, orderBy: ! contentVisibility.orderBy, }, } ) } /> ); }; export const getSharedListControls = ( attributes, setAttributes ) => { return ( <SelectControl label={ __( 'Order Products By', 'woocommerce' ) } value={ attributes.orderby } options={ [ { label: __( 'Default sorting (menu order)', 'woocommerce' ), value: 'menu_order', }, { label: __( 'Popularity', 'woocommerce' ), value: 'popularity', }, { label: __( 'Average rating', 'woocommerce' ), value: 'rating', }, { label: __( 'Latest', 'woocommerce' ), value: 'date', }, { label: __( 'Price: low to high', 'woocommerce' ), value: 'price', }, { label: __( 'Price: high to low', 'woocommerce' ), value: 'price-desc', }, ] } onChange={ ( orderby ) => setAttributes( { orderby } ) } /> ); };