• Resolved ali2xja

    (@ali2xja)


    Hello

    I am building a shipping cost calculator.
    This calculator has these input fields:
    1. Kilometres from sender to reciever.
    2 Number of Packets
    3. Packet Width, Packet Length, and Packet Height.
    4. Packet weight.
    I store store the volume and the weight of the total package using two formulas.
    I also have a radio select with 5 inputs which are selected based in the formulas above.
    The thing is that both the formulas can change the radio select, and at the moment of speaking the radio select is changed based on which formula changes the latest.
    E.x
    I have a vehicle which can store a package with a max volume of 10m3 and a max weight of 10kg, and another vehicle which can store a max volume of 20m3 and a max weight of 20kg.
    Let’s suppose that I enter a package with a volume of 15m3, and the second car is selected. But if I calculate the weight of the package and it has a weight of 5kg the first vehicle is selected, even though it has a bigger volume than 10m3.

    Can you tell me how can I achieve that the biggest vehicle (radio select) is selected when changing these fields.

    Sorry for the long writing ??

Viewing 1 replies (of 1 total)
  • jacobstylemixthemes

    (@jacobstylemixthemes)

    Hello,

    No worries about writing long but thank you for providing additional details about your shipping cost calculator setup! Understanding your requirement better now, it’s important to address the capabilities of the Cost Calculator Builder plugin, particularly the distinctions between the free and Pro versions.

    Your project, which involves dynamically selecting the appropriate vehicle based on both the volume and weight of packages, requires a form of conditional logic. In the free version of the Cost Calculator Builder plugin, such advanced conditional logic features are typically not available. This limitation might be why you’re facing issues with having the calculator make the right vehicle selection based on both weight and volume.

    From your description, it seems you need a logic that selects the vehicle not just based on the latest calculated value (volume or weight) but on a more comprehensive condition that considers both aspects together. Here’s a suggested approach to achieve this:

    1. Formula Adjustment: Instead of triggering the vehicle selection immediately after calculating the volume or weight, store these values in variables first.
    2. Combined Condition for Vehicle Selection: After both the volume and weight calculations are updated, run a conditional check to determine which vehicle fits the criteria. For example:
      • If volume <= 10m3 and weight <= 10kg, select Vehicle 1.
      • If volume > 10m3 or weight > 10kg (but within the capacity of Vehicle 2), select Vehicle 2.
    3. Event Trigger: This conditional check should be triggered every time there is a change in the input fields related to the volume or weight calculation. This ensures that both the latest volume and weight are considered together before making a vehicle selection.
    4. Handling Edge Cases: Consider cases where the input might exceed the capacity of both vehicles. You’ll need a condition to handle such scenarios, possibly by showing an alert or message indicating that the package size or weight exceeds available vehicle capacities.
    5. Updating the Radio Button: Based on the outcome of the conditional check, update the selection of the radio button to reflect the most suitable vehicle.

    To achieve the functionality where the vehicle selection is dependent on multiple conditions (both the volume and weight of the packets in this case), you would need the Pro version of the Cost Calculator Builder. The Pro version offers enhanced features, including:

    1. Advanced Conditional Logic: This allows you to set up complex conditions based on the input fields. You can create rules that consider both the total volume and weight before selecting the most suitable vehicle.
    2. Customizable Trigger Events: In the Pro version, you can configure the form to re-evaluate conditions whenever there’s a change in any related input, ensuring the most appropriate vehicle is selected based on the current data.
    3. Handling Multiple Scenarios: With the Pro version, you can set up various scenarios and provide fallback options, such as alerts or messages for cases where the input exceeds the capacity of all available vehicles.

    Given your requirements, upgrading to the Pro version would be the most effective solution. It will provide the necessary functionality to implement the dual-condition vehicle selection logic accurately.

    If upgrading to the Pro version isn’t feasible right now, another approach might involve some custom scripting or additional tools, but this could be complex and might not integrate as seamlessly with your current setup.

    I hope this clarifies the situation and helps you in making an informed decision for your project. If you have any more questions or need further assistance, feel free to ask.

    Best regards,

    Jacob, Support Team

Viewing 1 replies (of 1 total)
  • The topic ‘Radio button to keep it’s biggest value’ is closed to new replies.