Post by alex_itst » Wed Apr 21, 2021 10:59 pm

Greetings.
Opencart version: 3.0.3.6

Im new to opencart development and i came up with i problem i could not fix myself or find a fix anywhere on the internet. The problem is with the checkout page and ill try my best to describe it. I wanted to create a custom one page checkout so my first instinct was to get an extension and i bought ajax quick checkout page. But the extension had conflict with another shipping method extension and i decided to build my own checkout page. The first i notice i that most of the short-codes i used don't work.
for ex: i copied the code form shipping_method.twig into my panel were the shipping option would go and nothing works except the additional textbox field. the code in checkout.twig is as follows:

Code: Select all

{{ header}}
<div class="container" id="container">
    {% if error_warning %}
        <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <{{ error_warning }}
            <button type="button" class="close" data-dismiss="alert">&times;</button>
        </div>
    {% endif %}
    <div class="row">{{ column_left }}
        {% if column_left and column_right %}
            {% set class = 'col-sm-6' %}
        {% elseif column_left or column_right %}
            {% set class = 'col-sm-9' %}
        {% else %}
            {% set class = 'col-sm-12' %}
        {% endif %}
        <div id="content" class="{{ class }}">{{ content_top }}
        <div class="row  " >
            <div class="col-lg-4" id ="customcheckout_address">
                <div class="custom_address_heading"><h4>{{ text_your_details }}</h4> </div>
                <div class="custom_address_fields">
                    <form>
                        <div class="col-lg-6">
                            <div id="first_name_label"><label for="input-payment-firstname">{{ entry_firstname }}</label><span> *</span></div>
                            <div id="first_name_input"><input type="text" name="firstname" value="{{ firstname }}" placeholder="{{ entry_firstname }}" id="input-payment-firstname"  required /></div>

                        </div>
                        <div class="col-lg-6">
                            <div id="last_name_label"><label  for="input-payment-lastname">{{ entry_lastname }}</label><span> *</span></div>
                            <div id="last_name_input"><input type="text" name="lastname" value="{{ lastname }}" placeholder="{{ entry_lastname }}" id="input-payment-lastname"/></div>

                        </div>
                        <div class="col-lg-12" style="padding-right: 0px;">
                            <div id="email_label"><label  for="input-payment-email">{{ entry_email }}</label><span> *</span></div>
                            <div id="email_input" ><input type="text" name="email" value="{{ email }}" placeholder="{{ entry_email }}" id="input-payment-email" /></div>
                        </div>
                        <div class="col-lg-12" style="padding-right: 0px;">
                            <div id="telephone_label"><label class="control-label" for="input-payment-telephone">{{ entry_telephone }}</label><span> *</span></div>
                            <div id="email_input" ><input type="text" name="telephone" value="{{ telephone }}" placeholder="{{ entry_telephone }}" id="input-payment-telephone" /></div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="col-lg-8 custom-right-panel">
                <div class="col-lg-6 ">
                    <div class="col-lg-12"><h4>{{ text_checkout_shipping_method }}</div>
                    <div class="col-lg-12">

                            <p>{{ text_shipping_method }}</p>
                            {% for shipping_method in shipping_methods %}
                                <p><strong>{{ shipping_method.title }}</strong></p>
                                {% if not shipping_method.error %}
                                    {% for quote in shipping_method.quote %}
                                        <div class="radio">
                                            <label> {% if quote.code == code or not code %}
                                                    {% set code = quote.code %}
                                                    <input type="radio" name="shipping_method" value="{{ quote.code }}" checked="checked" />
                                                {% else %}
                                                    <input type="radio" name="shipping_method" value="{{ quote.code }}" />
                                                {% endif %}
                                                {{ quote.title }} - {{ quote.text }}</label>
                                        </div>
                                    {% endfor %}
                                {% else %}
                                    <div class="alert alert-danger alert-dismissible">{{ shipping_method.error }}</div>
                                {% endif %}
                            {% endfor %}

                        <p><strong>{{ text_comments }}</strong></p>
                        <p>
                            <textarea name="comment" rows="8" class="form-control">{{ comment }}</textarea>
                        </p>
                        <div class="buttons">
                            <div class="pull-right">
                                <input type="button" value="{{ button_continue }}" id="button-shipping-method" data-loading-text="{{ text_loading }}" class="btn btn-primary" />
                            </div>
                        </div>

                    </div>

                </div>
                <div class="col-lg-6">asdasd</div>
            </div>

        </div>

            {{ content_bottom }}</div>
        {{ column_right }}</div>
</div>
{{ footer }}
Also i should mention i tired to leave the original script in the file on or of but no difference in the outcome so i didn't uploaded it here.

Second i need a guide on the usage and all the names of the shortcodes. Is there anywhere i can see all of them and is there any online guide or documentation on how to properly use and edit them.

Thank you for your time.

Newbie

Posts

Joined
Tue Mar 30, 2021 9:21 pm

Post by OSWorX » Wed Apr 21, 2021 11:55 pm

alex_itst wrote:
Wed Apr 21, 2021 10:59 pm
.. i need a guide on the usage and all the names of the shortcodes ..
What do you understand as "shortcodes"?

If you means something like this:

Code: Select all

{% if error_warning %}
This is only the TWIG-Syntax.

Where

Code: Select all

{% if %}
is part of this syntax and

Code: Select all

error_warning
only the variable produced by the corresponding controller.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: No registered users and 29 guests