I'm trying to add a custom value for the addtocart function in Hybris Commerce b2c. Is a boolean in with a checkbox.
I've add the bol custom value in core-items.xml but now I need to get that value when the checkbox is selected before press the addToCart Button and then show that value in the checkout page.
I thing it's not a short task, but I just want to understand the data flow for this kind of process, that's the complex part.
If someone have time to explain something, it will be grate! Thanks !
<form:form method="post" id="addToCartForm" class="add_to_cart_form" action="${addToCartUrl}">
<div>
<div class="custom-control custom-checkbox">
<input path="trasiego" onclick="ACC.productDetail.enableMinusBtn()" type="checkbox" class="custom-control-input" id="trasiego">
<form:checkbox path="trasiego" value="true"/>
<spring:theme code="product.pdp.pedidoTrasiego"/>
</div>
</div>
<input type="hidden" maxlength="3" size="1" id="qty" name="qty" class="qty js-qty-selector-input" value="1">
<input class = "js-simulate-validate-link" type="hidden" name="productCodePost" value="${fn:escapeXml(product.code)}"/>
<ycommerce:testId code="simulateButton">
<button id="simulateButton" type="button" data-error-simulate-url="${fn:escapeXml(simulatePopup)}" data-simulate-title="<spring:theme code="text.simulate"/>" class="btn btn-default btn-block js-add-to-cart" disabled=disabled">
<spring:theme code="basket.simulate"/>
</button>
</ycommerce:testId>
<ycommerce:testId code="addToCartButton">
<button id="addToCartButton" type="submit" class="btn btn-primary btn-block" disabled=disabled>
<spring:theme code="basket.buy"/>
</button>
<br>
</ycommerce:testId>
</form:form>