Forum

Thread tagged as: Shop

So the default in customer create is:

<fieldset>
    <legend>Billing address</legend>
    <div>
        <perch:label for="company">Company</perch:label>
        <perch:input type="text" id="company" label="Company" />
    </div>

    <div>
        <perch:label for="address_1">Address 1</perch:label>
        <perch:input type="text" id="address_1" required="true" label="Address 1" />
        <perch:error for="address_1" type="required">Please add the first line of your address</perch:error>
    </div>

    <div>
        <perch:label for="address_2">Address 2</perch:label>
        <perch:input type="text" id="address_2" label="Address 2" />
    </div>

    <div>
        <perch:label for="postcode">Postal code</perch:label>
        <perch:input type="text" id="postcode" label="Postal code" />>
    </div>

    <div>
        <perch:label for="city">City</perch:label>
        <perch:input type="text" id="city" label="City" />
    </div>

    <div>
        <perch:label for="county">State or County</perch:label>
        <perch:input type="text" id="county" label="County" />
    </div>

    <div>
        <perch:label for="country">Country</perch:label>
        <perch:input type="select" options="<perch:shop id="country_list" />" value="236" id="country" label="Country" />
    </div>

</fieldset>

My template is now:

<div class="form-elements">
    <h4>Billing Address</h4>
    <div id="postcode_lookup"></div>
    <perch:input type="text" id="line1" class="line1" required="true" placeholder="Address 1" />
    <perch:input type="text" id="line2" class="line2" placeholder="Address 2" />
    <perch:input type="text" id="line3" class="line3" placeholder="Address 3" />
    <perch:input type="text" id="town" class="town" placeholder="Town" />
    <perch:input type="text" id="county" class="county" placeholder="County" />
    <perch:input type="text" id="postcode" class="postcode" required="true" placeholder="Postcode" />
</div>

Not sure if that will help.

Drew McLellan

Drew McLellan 2638 points
Perch Support

You need to keep the IDs in order for Perch to handle the address for you.

Thanks for clarifying Drew. I have changed them back to the default ids but adding new ones is allowing this now so all good! Thanks :)

With regards to the shipping. What is the best way to apply shipping per product added to cart?

So all products are the same on our shop and we want to apply the same shipping. So if one product is added it applies £3.95. If another product is added I want it to then be £7.95.

The only way I have managed to do this so far is using weights and setting up a different shipping method for the amount of products but I thought there must be an easier way? Hope that makes sense.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Weights would be the way to do it.

How would I do that differently to how I am doing it then? This might be the wrong way of doing it but I set the weight of each product as 1, then in my shipping I set the max shipping weight as 1. Then for 2 bags I set up a 2 bags shipping method setting the max weight of 2. This works but where do I draw the line of how many shipping methods to setup. I thought there must be an automated way of just applying 1 shipping method. However messing around with weights I couldn't get it to just apply it to each product added :(

Drew McLellan

Drew McLellan 2638 points
Perch Support

How is it not working? I'm not sure what problem we're trying to solve - there's so many issues in this thread.