In the shop I'm developing, users can only see prices and add products to cart only if they create an account. After the user signs up and logs in, the options Billing Details & Delivery Details are automatically filled in with the user's address. All he has to do is click "Continue". The delivery method is set to free and the payment method is set to "cash on delivery".
How can I automatically select these options and hide them so the only step left would be to Confirm the order?
I assume the template file I need to change is catalog/view/theme/default/template/checkout/checkout.tpl but it's almost a 1k lines long and uses ajax which I have very little knowledge of.
I've been trying to do this for a few hours so any help would be greatly appreciated! (question also posted on stackoverflow)
Thanks for the reply! I found my answer here. I managed to get it working for Step 3 (delivery method - shipping.tpl) and Step 4 (payment method - payment.tpl). However, if I add the same thing to address.tpl, it send the form into an infinite loop... apparently address.tpl is called upon multiple times.
Here's what I added to address.tpl:
Where should I put this code so it will only be called upon once for step 2 - billing details and once for step3 - delivery details?
Thanks again!
Here's what I added to address.tpl:
Code: Select all
<script language="Javascript" type="text/javascript">
$(document).ready(function(){
$('#button-address').trigger('click');
alert('test'); // to see how many time it's called
});
</script>
Thanks again!
Who is online
Users browsing this forum: Semrush [Bot] and 41 guests