HummingbirdHammocks / hummingbird-hammocks

BSD Zero Clause License
0 stars 0 forks source link

Missing Cart page #40

Closed loidolt closed 2 years ago

loidolt commented 2 years ago

We need an actual cart page to accommodate the extra functionality we have there prior to checkout. See screenshot below:

Screenshot 2022-09-02 163923

thejahid commented 2 years ago

Sir, I don't know shopify buy sdk has those option.... I push the last code Proceed to Checkout button work now can you please check

loidolt commented 2 years ago

Currently, these are handled using cart attributes. It appears the cart API supports this feature: https://shopify.dev/api/ajax/reference/cart.

Below is the current code that handles this so you can match the field names:

<p class="cart-attribute__field" style="padding-top: 20px;">
    <input type="hidden" name="attributes[Packing Slip]" value="No" />
    <input type="checkbox" name="attributes[Packing Slip]" value="Yes"{% if cart.attributes["Packing Slip"] == "Yes" %} checked{% endif %}>
    <label style="font-size: 16px; display: inline; padding-left: 5px;">Include Paper Packing Slip</label>
    <br />
    <i>To reduce waste, we don't print a paper packing slip. If you would like a packing slip please check this box.</i>
</p>
<p class="cart-attribute__field" style="padding-top: 20px;">
    <input type="hidden" name="attributes[Gift Order]" value="No" />
    <input type="checkbox" name="attributes[Gift Order]" value="Yes"{% if cart.attributes["Gift Order"] == "Yes" %} checked{% endif %}>
    <label style="font-size: 16px; display: inline; padding-left: 5px;">Gift Order</label>
    <br />
    <i>Gift orders will include a paper packing slip with no prices.</i>
</p>
<div style="margin-top: 60px; margin-bottom: 40px;">
    <h4 style="text-align: center;">Ordering for a Thru-Hiker?</h4>
    <hr />
    <div class="thru-hiker">
        <div class="left">
            <p>
                Let us know who will be picking up the order and the estimated pickup date so we can be sure your package is routed correctly!
                <br />
                <br />
                Your order will be labeled with a large sticker indicating the hiker's name and estimated pickup date so it can be easily identified by the postal service and the location holding the package for pickup.
            </p>
        </div>
        <div class="right">
            <p class="cart-attribute__field">
                <label for="thru-hiker-full-name">Thru-Hiker Full Name</label>
                <input id="thru-hiker-full-name" type="text" name="attributes[Thru-Hiker Full Name]" value="{{ cart.attributes["Thru-Hiker Full Name"] }}">
            </p>
            <p class="cart-attribute__field">
                <label for="thru-hiker-estimated-pickup-date">Thru-Hiker Estimated Pickup Date:</label>
                <input id="thru-hiker-estimated-pickup-date" type="text" name="attributes[Thru-Hiker Estimated Pickup Date]" value="{{ cart.attributes["Thru-Hiker Estimated Pickup Date"] }}">
            </p>
        </div>
    </div>
</div>
thejahid commented 2 years ago

I created the cart page sir, you can check... can you please add thru hiker functionality 'cause I don't understand that