- Posts: 3
- Thank you received: 0
- Forum
- Support questions
- WooPrice Calculator (Pro)
- [SOLVED] Using Conditional Logic Show/Hide within "example_custom.php"
×
WooPrice Calculator PRO
[SOLVED] Using Conditional Logic Show/Hide within "example_custom.php"
- Justin Leonard
-
Topic Author
- Offline
Less
More
1 year 4 months 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").
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.
- Justin Leonard
-
Topic Author
- Offline
Less
More
- Posts: 3
- Thank you received: 0
1 year 4 months 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.
- Paul
-
- Offline
Less
More
- Posts: 117
- Thank you received: 1
1 year 4 months 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:This code for your field id 12:
So we followed this
Let us know if this solved your problem.
Best Regards,
Paul
AT488
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'; ?>">
<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
Please Log in or Create an account to join the conversation.
- Justin Leonard
-
Topic Author
- Offline
Less
More
- Posts: 3
- Thank you received: 0
1 year 4 months ago - 1 year 4 months 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":
Custom Theme Code:
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>
Last Edit: 1 year 4 months ago by Justin Leonard. Reason: Add files
Please Log in or Create an account to join the conversation.
Moderators: david
- Forum
- Support questions
- WooPrice Calculator (Pro)
- [SOLVED] Using Conditional Logic Show/Hide within "example_custom.php"
Time to create page: 0.290 seconds