Adding custom fields to Spotlight theme

Adding custom fields to Spotlight theme

Comms-webmaster
Tourist
3 0 0

Hi there, 
I want to add two new custom fields to my cart page. 

I've followed the instructions here . I did not have the cart-template.liquid or cart-template.liquid in the Spotlight theme and instead added the code to sections/main-cart-items.liquid. 

 

 

 

      <p class="cart-attribute__field">
  <label for="unitdepartment">Unit/Department</label>
  <input required class="required" id="unitdepartment" type="text" name="attributes[Unit/Department]" value="{{ cart.attributes["Unit/Department"] }}">
</p>

  <p class="cart-attribute__field">
  <label for="budgetcode">Budget Code</label>
  <input required class="required" id="budgetcode" type="text" name="attributes[Budget Code]" value="{{ cart.attributes["Budget Code"] }}">
</p>

 

 

 

I am getting a validation error: 

"you can only add this item in increments of" 

 

Any ideas how I can fix this? 

 

 

Replies 2 (2)

Comms-webmaster
Tourist
3 0 0

Same issue in the Dawn  and Craft themes. 

Comms-webmaster
Tourist
3 0 0

If it is relevant - I have disabled all payment types. I am using this system only for orders and inventory and no payment. However I want to show prices, and track quantity and allow checkout - with these two additional custom fields.