I will name it Pickup from store.
What I have done so far:
Step 1)
Here: /catalog/view/theme/default/template/checkout/checkout.twig
I found on line 145 (url: 'index.php?route=checkout/' + $('input[name=\'account\']:checked').val(),)
So my thoughts are to insert another option to account variable to redirect to another page.
Code: Select all
// Checkout
$(document).delegate('#button-account', 'click', function() {
$.ajax({ //line 146
url: 'index.php?route=checkout/' + $('input[name=\'account\']:checked').val(), //line 147
dataType: 'html',
Here /catalog/view/theme/default/template/checkout/login.twig
in line 13 onwards the file is edited as follows in order to create another radiobutton with the variable of account and the value of "guest_store".
Code: Select all
{% if checkout_guest %}
<div class="radio">
<label> {% if account == 'guest' %}
<input type="radio" name="account" value="guest" checked="checked" />
{% else %}
<input type="radio" name="account" value="guest" />
{% endif %}
{{ text_guest }}</label>
</div>
<div class="radio">
<label> {% if account == 'guest' %}
<input type="radio" name="account" value="guest_store" checked="checked" />
{% else %}
<input type="radio" name="account" value="guest_store" />
{% endif %}
{{ text_guest_store }}Chekout from store</label> //created and set the variable in the language file. I write this here just for clarity.
</div>
{% endif %}
If I am correct (apparently I am not) if the third radiobutton is selected and the button is pressed then it should redirect to:
"/index.php?route=checkout/guest_store". So I did the following:
In: /catalog/controller/checkout
I duplicated the file "guest.php" and renamed it to "guest_store.php"
So finally the second step of the checkout should be redirected to show whatever the "guest_store.php" file has there but unfortunately I get an error 500
GET mystore.com/index.php?route=checkout/guest_store 500 (Internal Server Error)
send @ jquery-2.1.1.min.js:4
ajax @ jquery-2.1.1.min.js:4
(anonymous) @ index.php?route=checkout/checkout:1048
dispatch @ jquery-2.1.1.min.js:3
r.handle @ jquery-2.1.1.min.js:3
The: (anonymous) @ index.php?route=checkout/checkout:1048 as I see from chrome console, refers to the ajax code line in: /catalog/view/theme/default/template/checkout/checkout.twig in line 146
Code: Select all
$(document).delegate('#button-account', 'click', function() {
$.ajax({ //line 146
url: 'index.php?route=checkout/' + $('input[name=\'account\']:checked').val(),
dataType: 'html',