My Environment is:
- WordPress 4.7.4
- Debian Linux 8
- WooCommerce 3.0.5
- 256M Memory
I've tried a number of solutions including:
- Add custom variable to cart content
- WooCommerce Show Attributes plugin
However, I'm still not getting the right result and time is of the essence at this point of this project. A precision, I have the same price for all attribute values…
I created a custom single-product.php tempalte with a custom form:
<form id="add-product-form" class="add-product-form form-horizontal" method="post" action="">
<input name="add-to-cart" value="15709" type="hidden">
<div class="form-group color-dropdown">
<label class="col-sm-3 control-label">Color</label>
<select id="color-options" class="col-sm-9 color-select" name="color" required="">
<option value="auburn">Auburn</option>
<option value="black">Black</option>
<option value="mahogany-ash">Mahogany Ash</option>
<option value="mocha">Mocha</option> </select>
</div>
<div class="form-group quantity-area">
<label class="col-sm-3 control-label">Qty.</label>
<input name="quantity" id="quantity" maxlength="2" class="col-sm-9 quantity-input" required="" type="text">
</div>
<button id="submit-to-cart" value="Add to Cart" class="btn btn-a2c submit" name="submit" type="submit"><i class="fa fa-plus" aria-hidden="true"></i> Add to Cart</button>
</form>
This form uses an AJAX post method and adds to cart as intended.
However:
- I'm not seeing the color they chose listed on the WC Cart page
- I'm not seeing the color they chose listed on the WC Checkout page
- I'm not seeing the color they chose on the corresponding emails. I know I have to edit email-order-items.php but I don't know the right approach here.
My question:
So How can I add a Custom Attribute selected value to Cart, Checkout, Order and email notification?
I know I can take the Variable product approach, but even at 256M memory, the Variations menu in the Variable Product area constantly spins so I can never get to this area to Add Variations.