Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Bug with group + addmore #8038
    kcarwile
    Participant

    I submitted a pull request with the fix for this bug.

    https://github.com/piklist/piklist/pull/6

    in reply to: Bug with group + addmore #8037
    kcarwile
    Participant

    My god.

    <?php
    /*
    Title: Test
    Post Type: page
    */
    
    piklist( 'field', array(
    	'type'      => 'group',
    	'field'     => 'rate_options',
    	'label'     => 'Option Prices',
    	'value'     => isset( $rate ) ? $rate->data : array(),
    	'add_more'  => true,
    	'fields'    => array(
    		array(
    			'type'       => 'text',
    			'field'      => 'option_name',
    			'label'      => 'Name',
    			'required'   => true,
    			'sanitize'   => array( array( 'type' => 'text_field' ) ),
    			'attributes' => array(
    				'placeholder' => 'Option Name',
    			),
    		),
    		array(
    			'type'     => 'select',
    			'field'    => 'option_type',
    			'label'    => 'Price Increase',
    			'choices'  => array(
    				1 => 'By Units',
    				2 => 'Fixed',
    				3 => 'Multiplier',
    			),
    		),
    		array(
    			'type'       => 'number',
    			'field'      => 'option_rate',
    			'label'      => 'Rate',
    			'attributes' => array(
    				'placeholder' => 'Rate',
    				'step' => '0.01',
    				'min' => '0',
    				'style' => 'max-width: 100px',
    			),
    		),
    		array( 
    			'type'  => 'number',
    			'field' => 'option_unit_size',
    			'label' => 'Rate Units',
    			'conditions' => array(
    				array(
    					'field' => 'rate_options:option_type',
    					'value' => '1',
    				),
    			),
    			'attributes' => array(
    				'style' => 'max-width: 100px',
    			),
    		),
    		array( 
    			'type'  => 'number',
    			'field' => 'option_min_cost',
    			'label' => 'Minimum Cost',
    			'attributes' => array(
    				'step' => '0.01',
    				'min'  => '0',
    				'style' => 'max-width: 100px',
    			),
    			'conditions' => array(
    				array(
    					'field' => 'rate_options:option_type',
    					'value' => '1',
    				),
    			),
    		),
    		array( 
    			'type'  => 'number',
    			'field' => 'option_max_height',
    			'label' => 'Maximum Height',
    			'conditions' => array(
    				array(
    					'field' => 'rate_options:option_type',
    					'value' => '1',
    				),
    			),
    			'attributes' => array(
    				'style' => 'max-width: 100px',
    			),
    		),
    		array( 
    			'type'  => 'number',
    			'field' => 'option_max_width',
    			'label' => 'Maximum Width',
    			'conditions' => array(
    				array(
    					'field' => 'rate_options:option_type',
    					'value' => '1',
    				),
    			),
    			'attributes' => array(
    				'style' => 'max-width: 100px',
    			),
    		),
    	),
    ) );
    in reply to: Bug with group + addmore #8036
    kcarwile
    Participant

    Ok, here is the file in text format.

Viewing 3 posts - 1 through 3 (of 3 total)