Lesson 5: Implementing a Double-Sided Boolean Modifier with Conditional Logic

Tyler MacDonald Updated by Tyler MacDonald

Objective

Introduce Boolean logic for additional product customizations.

Outcome

By the end of this lesson, your product will include customizable features like double-sided printing, enhancing its flexibility.

Note: In this lesson, we introduce Boolean Ternary Logic, a powerful tool that can produce fascinating results when applied effectively.

Step 1: Copy the Previous Lesson's Product and Rename

As with previous lessons, each subsequent lesson will be a copy of the last. Follow these steps:

  1. Copy the Product
    • From Lesson 4: Adding a Default Item Linked to Modifiers, click on the blue action button and select Copy Product.
    • This will generate a copy of the product, which will be in Draft Mode.
  2. Update Basic Settings
    • Click on Basic Settings and update the following fields:
      • Product Name: Lesson 5: Implementing a Double-Sided Boolean Modifier with Conditional Logic
      • Product Description: The product includes customizable features like double-sided printing, enhancing flexibility.

Step 2: Adding a Double-Sided Boolean Checkbox

  1. Scroll to the Product Template
    • Scroll to the bottom of the page where Modifiers, Dropdown Menus, and Default Items are located.
  2. Add a Modifier
    • Click +Add New.
    • Choose Double_Sided from the list.
    • Now that the Double-Sided checkbox is enabled, we need to tie it in with some custom logic.

Step 3: Modifying the Default Item with Custom Logic

  1. Edit the Default Item
    • Open Default Items, select Generic Printer, and click the blue edit pencil.
  2. Apply Custom Logic
    • Click Custom, and enter the following code:
    (Double_Sided) ? 2 : 1;
    This code checks if the Double_Sided checkbox is checked. If it is, the system formula multiplies the Area by 2; if not, it multiplies the Area by 1.

Step 4: Configuring and Publishing the Product

Once saved, you'll remain on the Configure Pricing screen by default.

Draft Mode

All newly created products, or copies of products, are initially set to Draft Mode. This feature allows you to work on a product without introducing it into the main system.

Publishing the Product

To publish your product:

  1. Select the blue action button in the top right corner.
  2. Choose Publish Product from the dropdown menu.

Once published, the draft tag will disappear, indicating that the product is now active and ready to be used in transactions.

Step 5: Adding the Product to a Transaction

Using the quote started in the previous lesson, let's add this new product as a line item.

  • Enter a Width and Height of 120".
  • Select a Material from your dropdown.
  • Click and unclick the Double Sided Check Box
  • Click Save.

Conclusion

Congratulations! You've successfully implemented Boolean logic to enhance your product's flexibility with features like double-sided printing. Your product is now more customizable and responsive to user inputs. In the next lesson, we’ll explore even more advanced customization options to further refine and expand your product's capabilities.

How did we do?

Lesson 4: Adding a Default Item Linked to Modifiers

Lesson 6: Replacing a System Formula with a Custom Formula

Contact