Total : 0.00 €

Before contacting us, please make sure to check our F.A.Q

Please, login or register to our website in order to be able to post a presale question in the forum.

× WooPrice Calculator PRO

Using Conditional Logic Show/Hide within "example_custom.php"

More
1 month 3 days ago #1611 by Justin Leonard
Justin Leonard replied the topic: Using Conditional Logic Show/Hide within "example_custom.php"
Tested the provided code and worked successfully.

For others working on a similar solution you will just need to make sure the "data-field-id=12" and "($this->view[12] == true)" both have matching ID's to your fields (in this example "12").

Please Log in or Create an account to join the conversation.

More
1 month 6 days ago #1609 by Justin Leonard
Justin Leonard replied the topic: Using Conditional Logic Show/Hide within "example_custom.php"
Thank You Paul, I will be testing this shortly and will confirm the solution status!

Please Log in or Create an account to join the conversation.

More
1 month 6 days ago #1607 by Paul
Paul replied the topic: Using Conditional Logic Show/Hide within "example_custom.php"
Hello,

We modified your custom theme. You can see it in the attachment file.
This code for your field id 11:
<div class="awspc-field-row" data-field-id="11" style="<?php echo ($this->view['conditionalLogic'][11] == true)?'':'display:none'; ?>">
This code for your field id 12:
<div class="awspc-field-row" data-field-id="12" style="<?php echo ($this->view['conditionalLogic'][12] == true)?'':'display:none'; ?>">

So we followed this

Let us know if this solved your problem.

Best Regards,
Paul
AT488
Attachments:

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago - 1 month 1 week ago #1602 by Justin Leonard
Justin Leonard created the topic: Using Conditional Logic Show/Hide within "example_custom.php"
Established a working Conditional Logic field list, works great on autogenerated theme.

However I would like to utilize my custom layout "example_custom.php" and include the conditional logic of show/hide.

I have included the 2 list fields below that I would like to add the Conditional Logic switch to but can't quite translate the conversion to the custom theme code from the original implementation:

Original Conditional Logic Code Provided in "example.php":
data-field-id="<?php echo $data['field']->id; ?>" style="<?php echo ($this->view['conditionalLogic'][$data['field']->id] == true)?"":"display:none"; ?>"

Custom Theme Code:
<div class="form-row">
                    <!--Field start - Left Pocket Options -->
                    <div id="<?php echo $this->view['data']['aws_price_calc_51']['elementId']; ?>" class="form-group col-md-6 awspc-field-widget" >
                        <div class="awspc-field <?php echo $this->view['data']['aws_price_calc_51']['class']; ?>">
                            <label for="<?php echo $this->view['data']['aws_price_calc_51']['elementId']; ?>_field">
			<?php echo $this->view['fields']['aws_price_calc_51']['label_name']; ?></label>
                            <?php echo $this->view['fields']['aws_price_calc_51']['html']; ?>
                        </div>
                        <div class="awspc-field-error"></div>
                    </div>
                <!--Field end-->
                    <!--Field start - Right Pocket Options -->
                    <div id="<?php echo $this->view['data']['aws_price_calc_52']['elementId']; ?>" class="form-group col-md-6 awspc-field-widget" >
                        <div class="awspc-field <?php echo $this->view['data']['aws_price_calc_52']['class']; ?>">
                            <label for="<?php echo $this->view['data']['aws_price_calc_52']['elementId']; ?>_field">
			<?php echo $this->view['fields']['aws_price_calc_52']['label_name']; ?></label>
                            <?php echo $this->view['fields']['aws_price_calc_52']['html']; ?>
                        </div>
                        <div class="awspc-field-error"></div>
                    </div>
                <!--Field end-->
                </div>
Attachments:
Last Edit: 1 month 1 week ago by Justin Leonard. Reason: Add files

Please Log in or Create an account to join the conversation.

Moderators: david
Time to create page: 0.162 seconds

Cart

Total : 0.00 €