Post by Stef97 » Mon Mar 15, 2021 1:33 am

Hey zusammen,

ich habe in unseren Opencart Shop das Plugin Power Product Builder von Sharley's Web Development installiert.

Nach dem erfolgreichen aktivieren kommt beim Aufruf der Produktseite ein Fatal Error mit der Fehlermeldung: PHP Fatal error: Uncaught Twig_Error_Syntax: Unknown "endif" tag in "default/template/product/product.twig" at line 199

Bei Zeile 199 habe ich kein endif - tag.

Hier ist ein Auszug von Zeile 193- 206:

Code: Select all

<div class="col-md-4 col-12">

          <div id="product"> {% if options %}
            <hr>
            <h3>{{ text_option }}</h3>
            {% for option in options %}
            {% if option.type == 'select' %} <!-- <-- Hier ist Zeile 199 -->
            <div class="form-group{% if option.required %} required {% endif %}">
              <div class="row mb-3">
                <div class="col-md-9 col-sm-8 col-6 pr-3">
                  <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
                </div>
                
              </div>
Wenn ich das Plugin wieder deaktiviere ist der Fehler verschwunden und alles funktioniert wieder.

Ich nutze Opencart 3.0.2.0 mit dem Theme zCamera.

Ich freue mich auf eure Hilfe :-) & hoffe, dass ihr mir dabei weiterhelfen könnt.

Schöne Grüße

New member

Posts

Joined
Thu Sep 13, 2018 2:24 pm

Post by Cue4cheap » Mon Mar 15, 2021 1:40 am

Bezahlte Erweiterung, nach der Sie sie fragen müssen.

cue4cheap not cheap quality


Active Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by Stef97 » Mon Mar 15, 2021 4:38 pm

Hi,

danke für deine Rückmeldung.

Ich habe den Support bereits kontaktiert, obwohl sie diesen eigentlich nicht mehr anbieten, in der Hoffnung, dass sie mir da weiterhelfen können.

Habt jemand dieses Plugin denn auch schon genutzt und hat diesen Fehler beheben können?

New member

Posts

Joined
Thu Sep 13, 2018 2:24 pm

Post by OSWorX » Mon Mar 15, 2021 9:18 pm

Stef97 wrote:
Mon Mar 15, 2021 1:33 am
.. das Plugin Power Product Builder von Sharley's Web Development installiert.
Und wieder eine schlechte und offensichtlich noch schlechter programmierte Erweiterung!
Wie schon ein anderer erwähnt hat (auch wenn man auf solche "Wortspenden" hier verzichnten kann), als 1. Anlaufstelle sollte immer der Anbieter/Entwickler selber angeschrieben werden.
Noch dazu wenn es sich dabei um eine kostenpflichtige Erweiterung handelt.

Stef97 wrote:
Mon Mar 15, 2021 1:33 am
Nach dem erfolgreichen aktivieren kommt beim Aufruf der Produktseite ein Fatal Error mit der Fehlermeldung: PHP Fatal error: Uncaught Twig_Error_Syntax: Unknown "endif" tag in "default/template/product/product.twig" at line 199

Bei Zeile 199 habe ich kein endif - tag.

Hier ist ein Auszug von Zeile 193- 206:

Code: Select all

<div class="col-md-4 col-12">

          <div id="product"> {% if options %}
            <hr>
            <h3>{{ text_option }}</h3>
            {% for option in options %}
            {% if option.type == 'select' %} <!-- <-- Hier ist Zeile 199 -->
            <div class="form-group{% if option.required %} required {% endif %}">
              <div class="row mb-3">
                <div class="col-md-9 col-sm-8 col-6 pr-3">
                  <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
                </div>
                
              </div>
Wenn ich das Plugin wieder deaktiviere ist der Fehler verschwunden und alles funktioniert wieder.

Ich nutze Opencart 3.0.2.0 mit dem Theme zCamera.
Fehlt einfach das hier:

Code: Select all

{% endif %}
Eventuell auch das hier:

Code: Select all

{% endfor %}
p.s.: der Einfachheit halber wäre es dienlicher dann den gesamten Code zu zeigen wenn das nicht hilft (egal ob kostenpflichtig oder nicht).

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

Post by Stef97 » Tue Mar 16, 2021 11:24 pm

Hey,

danke für deine Rückmeldung. Ja... Das habe ich auch getan. Bisher noch keine Rückmeldung.

An dieser Stelle ist es nicht sinnvoll, ein endif oder endfor zu integrieren, da die notwendige Schleife unterbrochen wird und es logisch nicht zusammenpasst. Diese

Meinst du mit Code den Code vom Plugin selbst?

Dies ist die product.twig aus dem zCamera Theme (Dieses habe ich auf 2 Posts aufgeteilt, da die 20000 Buchstabenlimitierung sonst überschritten ist...)

Code: Select all

{{ header }}
<div id="product-product" class="container">
  <ul class="breadcrumb">
    {% for breadcrumb in breadcrumbs %}
    <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
    {% endfor %}
  </ul>
  <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="col-sm-12">{{ content_top }}
      <div class="row"> {% if column_left or column_right %}
        {% set class = 'col-sm-6' %}
        {% else %}
        {% set class = 'col-sm-8' %}
        {% endif %}
        <div class="col-md-8 col-12">

            <h1>{{ heading_title }}</h1>
            <div class="btn-group pull-right">
              <button type="button" data-toggle="tooltip-bs" class="btn btn-default" title="{{ button_wishlist }}" onclick="wishlist.add('{{ product_id }}');"><i class="fa fa-heart"></i></button>
            </div>
            <ul class="list-unstyled productData">
              {% if manufacturer %}
                <li>{{ text_manufacturer }}: {{ manufacturer }}</li>
              {% endif %}
                <li>{{ text_model }} {{ model }}</li>
              {% if price %}
                {% if not special %}
                  <li>
                    <h3 class="price">{{ price }}</h3>
                  </li>
                {% else %}
                  <li><span style="text-decoration: line-through;">{{ price }}</span></li>
                  <li>
                    <h2 class="price">{{ special }}</h2>
                  </li>
                {% endif %}
                {% if points %}
                  <li>{{ text_points }} {{ points }}</li>
                {% endif %}
              {% endif %}
              {% if discounts %}
                <li>
                  <hr>
                </li>
                {% for discount in discounts %}
                  <li>{{ discount.quantity }}{{ text_discount }}{{ discount.price }}</li>
                {% endfor %}
              {% endif %}
              {% if reward %}
                <li>{{ text_reward }} {{ reward }}</li>
              {% endif %}
                <!-- <li>{{ text_stock }} {{ stock }}</li> -->
            </ul>





        {% if thumb or images %}
          <ul class="thumbnails">
            {% if thumb %}
            <li><a class="thumbnail" href="{{ popup }}" title="{{ heading_title }}"><img src="{{ thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" /></a></li>
            {% endif %}
            {% if images %}
            {% for image in images %}
            <li class="image-additional"><a class="thumbnail" href="{{ image.popup }}" title="{{ heading_title }}"> <img src="{{ image.thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" /></a></li>
            {% endfor %}
            {% endif %}
          </ul>
          {% endif %}
          <ul class="nav nav-tabs">
            <li class="active"><a href="#tab-description" data-toggle="tab">{{ tab_description }}</a></li>
            {% if attribute_groups %}
            <li><a href="#tab-specification" data-toggle="tab">{{ tab_attribute }}</a></li>
            {% endif %}
            {% if review_status %}
            <li><a href="#tab-review" data-toggle="tab">{{ tab_review }}</a></li>
            {% endif %}
          </ul>
          <div class="tab-content">
            <div class="tab-pane active" id="tab-description">{{ description }}</div>

            {% for option in options %}

                    {% if option.product_option_info is not empty and option.product_option_description is not empty %}
                      <div class="descriptionOfOptions">
                      	<div id="tooltip_content{{ option.product_option_id }}">
                          <p class="option_description">{{ option.product_option_description|nl2br }}</p>
                          <b class="text-danger">{{ option.product_option_info }} </b>
                         </div>
                      </div>
                    {% elseif option.product_option_image is not empty and option.product_option_description is not empty %}
                    <div class="descriptionOfOptions">
                    	<div id="tooltip_content{{ option.product_option_id }}">
                          <p class="option_description">{{ option.product_option_description|nl2br }}</p>
                          <div class="imageContainer">
                            <img src="{{ option.product_option_image }}" alt="optionsbilder" class="optionsBilder">
                          </div>
                        </div>
                      </div>

                    {% else %}
                      <div class="descriptionOfOptions">
                      	<div id="tooltip_content{{ option.product_option_id }}">
                          <p>{{ option.product_option_description|nl2br }}</p>
                        </div>
                      </div>
                    {% endif %}
                {% endfor %}
            {% if attribute_groups %}
            <div class="tab-pane" id="tab-specification">
              <table class="table table-bordered">
                {% for attribute_group in attribute_groups %}
                <thead>
                  <tr>
                    <td colspan="2"><strong>{{ attribute_group.name }}</strong></td>
                  </tr>
                </thead>
                <tbody>
                {% for attribute in attribute_group.attribute %}
                <tr>
                  <td>{{ attribute.name }}</td>
                  <td>{{ attribute.text }}</td>
                </tr>
                {% endfor %}
                  </tbody>
                {% endfor %}
              </table>
            </div>
            {% endif %}
            {% if review_status %}
            <div class="tab-pane" id="tab-review">
              <form class="form-horizontal" id="form-review">
                <div id="review"></div>
                <h2>{{ text_write }}</h2>
                {% if review_guest %}
                <div class="form-group required">
                  <div class="col-sm-12">
                    <label class="control-label" for="input-name">{{ entry_name }}</label>
                    <input type="text" name="name" value="{{ customer_name }}" id="input-name" class="form-control" />
                  </div>
                </div>
                <div class="form-group required">
                  <div class="col-sm-12">
                    <label class="control-label" for="input-review">{{ entry_review }}</label>
                    <textarea name="text" rows="5" id="input-review" class="form-control"></textarea>

                  </div>
                </div>
                <div class="form-group required">
                  <div class="col-sm-12">
                    <label class="control-label">{{ entry_rating }}</label>
      <div class="text-center">
                    <span class="bewertung">{{ entry_bad }}</span>
                    <input type="radio" name="rating" value="1" />
                    &nbsp;
                    <input type="radio" name="rating" value="2" />
                    &nbsp;
                    <input type="radio" name="rating" value="3" />
                    &nbsp;
                    <input type="radio" name="rating" value="4" />
                    &nbsp;
                    <input type="radio" name="rating" value="5" />
                     <span class="bewertung">{{ entry_good }} </span>
				</div>
			</div>
                </div>
                {{ captcha }}
                <div class="buttons clearfix">
                  <div class="pull-right">
                    <button type="button" id="button-review" data-loading-text="{{ text_loading }}" class="btn btn-primary">{{ button_continue }}</button>
                  </div>
                </div>
                {% else %}
                <p>{{ text_login }}</p>
                {% endif %}
              </form>
            </div>
            {% endif %}</div>
        </div>
        {% if column_left or column_right %}
        {% set class = 'col-sm-6' %}
        {% else %}
        {% set class = 'col-sm-4' %}
        {% endif %}
        <div class="col-md-4 col-12">

          <div id="product"> {% if options %}
            <hr>
            <h3>{{ text_option }}</h3>
            {% for option in options %}
            {% if option.type == 'select' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <div class="row mb-3">
                <div class="col-md-9 col-sm-8 col-6 pr-3">
                  <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
                </div>
                
              </div>

              {% if option.name == "Akku" %}
                <select name="option[{{ option.product_option_id }}]" id="input-option{{ option.product_option_id }}" class="form-control productAkku">
                    <option value="">{{ text_select }}</option>
                    {% for option_value in option.product_option_value %}
                      <option value="{{ option_value.product_option_value_id }}" class="akkuOptions">{{ option_value.name }}
                    {% if option_value.price %}
                      ({{ option_value.price_prefix }}{{ option_value.price }})
                    {% endif %}
                    </option>
                    {% endfor %}
              </select>
              {% else %}
                <select name="option[{{ option.product_option_id }}]" id="input-option{{ option.product_option_id }}" class="form-control">
                    <option value="">{{ text_select }}</option>
                    {% for option_value in option.product_option_value %}
                      <option value="{{ option_value.product_option_value_id }}">{{ option_value.name }}
                    {% if option_value.price %}
                      ({{ option_value.price_prefix }}{{ option_value.price }})
                    {% endif %}
                    </option>
                    {% endfor %}
              </select>
              {% endif %}

            </div>
            {% endif %}
            {% if option.type == 'radio' %}
            <div class="form-group{% if option.required %} required {% endif %}">
            	<div class="row mb-3">
	                <div class="col-md-9 col-sm-8 col-6 pr-3">
	                  <label class="control-label">{{ option.name }}</label>
	                </div>
	                {% if option.product_option_description is not empty %}
	                  <div class="col-md-3 col-sm-4 col-6">
	                    <span class="optionInformation" value="{{option.product_option_id}}"><img src="image/information.png" alt="Information" data-tooltip-content="#tooltip_content{{option.product_option_id}}" class="informationPicture tooltip"></span>
	                  </div>
	                {% endif %}
              	</div>

              <div id="input-option{{ option.product_option_id }}"> {% for option_value in option.product_option_value %}
                <div class="radio">
                  <label>
                    <input type="radio" name="option[{{ option.product_option_id }}]" value="{{ option_value.product_option_value_id }}" />
                    {% if option_value.image %} <img src="{{ option_value.image }}" alt="{{ option_value.name }} {% if option_value.price %} {{ option_value.price_prefix }} {{ option_value.price }} {% endif %}" class="img-thumbnail" /> {% endif %}
                    {{ option_value.name }}
                    {% if option_value.price %}
                    ({{ option_value.price_prefix }}{{ option_value.price }})
                    {% endif %} </label>
                </div>
                {% endfor %} </div>
            </div>
            {% endif %}
            {% if option.type == 'checkbox' %}
            <div class="form-group{% if option.required %} required {% endif %}">
            	<div class="row mb-3">
	                <div class="col-md-9 col-sm-8 col-6 pr-3">
	                   <label class="control-label">{{ option.name }}</label>
	                </div>
	                {% if option.product_option_description is not empty %}
	                  <div class="col-md-3 col-sm-4 col-6">
	                    <span class="optionInformation" value="{{option.product_option_id}}"><img src="image/information.png" alt="Information" data-tooltip-content="#tooltip_content{{option.product_option_id}}" class="informationPicture tooltip"></span>
	                  </div>
	                {% endif %}
              	</div>

              <div id="input-option{{ option.product_option_id }}"> {% for option_value in option.product_option_value %}
                <div class="checkbox">
                  <label>
                    <input type="checkbox" name="option[{{ option.product_option_id }}][]" value="{{ option_value.product_option_value_id }}" />
                    {% if option_value.image %} <img src="{{ option_value.image }}" alt="{{ option_value.name }} {% if option_value.price %} {{ option_value.price_prefix }} {{ option_value.price }} {% endif %}" class="img-thumbnail" /> {% endif %}
                    {{ option_value.name }}
                    {% if option_value.price %}
                    ({{ option_value.price_prefix }}{{ option_value.price }})
                    {% endif %} </label>
                </div>
                {% endfor %} </div>
            </div>
            {% endif %}


            {% if option.type == 'text' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
              <input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" placeholder="{{ option.name }}" id="input-option{{ option.product_option_id }}" class="form-control" />
            </div>
            {% endif %}

New member

Posts

Joined
Thu Sep 13, 2018 2:24 pm

Post by Stef97 » Tue Mar 16, 2021 11:28 pm

Code: Select all

          
  {% if option.type == 'textarea' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
              <textarea name="option[{{ option.product_option_id }}]" rows="5" placeholder="{{ option.name }}" id="input-option{{ option.product_option_id }}" class="form-control">{{ option.value }}</textarea>
            </div>
            {% endif %}
            {% if option.type == 'file' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label">{{ option.name }}</label>
              <button type="button" id="button-upload{{ option.product_option_id }}" data-loading-text="{{ text_loading }}" class="btn btn-default btn-block"><i class="fa fa-upload"></i> {{ button_upload }}</button>
              <input type="hidden" name="option[{{ option.product_option_id }}]" value="" id="input-option{{ option.product_option_id }}" />
            </div>
            {% endif %}
            {% if option.type == 'date' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
              <div class="input-group date">
                <input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" data-date-format="YYYY-MM-DD" id="input-option{{ option.product_option_id }}" class="form-control" />
                <span class="input-group-btn">
                <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
                </span></div>
            </div>
            {% endif %}
            {% if option.type == 'datetime' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
              <div class="input-group datetime">
                <input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" data-date-format="YYYY-MM-DD HH:mm" id="input-option{{ option.product_option_id }}" class="form-control" />
                <span class="input-group-btn">
                <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                </span></div>
            </div>
            {% endif %}
            {% if option.type == 'time' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
              <div class="input-group time">
                <input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" data-date-format="HH:mm" id="input-option{{ option.product_option_id }}" class="form-control" />
                <span class="input-group-btn">
                <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                </span></div>
            </div>
            {% endif %}
            {% endfor %}
            {% endif %}
            {% if recurrings %}
            <hr>
            <h3>{{ text_payment_recurring }}</h3>
            <div class="form-group required">
              <select name="recurring_id" class="form-control">
                <option value="">{{ text_select }}</option>
                {% for recurring in recurrings %}
                <option value="{{ recurring.recurring_id }}">{{ recurring.name }}</option>
                {% endfor %}
              </select>
              <div class="help-block" id="recurring-description"></div>
            </div>
            {% endif %}
            <div class="form-group">
              <label class="control-label" for="input-quantity">{{ entry_qty }}</label>
              <input type="text" name="quantity" value="{{ minimum }}" size="2" id="input-quantity" class="form-control" />
              <input type="hidden" name="product_id" value="{{ product_id }}" />
              <br />
              <button type="button" id="button-cart" data-loading-text="{{ text_loading }}" class="btn btn-primary btn-lg btn-block">{{ button_cart }}</button>
            </div>
            {% if minimum > 1 %}
            <div class="alert alert-info"><i class="fa fa-info-circle"></i> {{ text_minimum }}</div>
            {% endif %}</div>


             <div>
               	{{ pflichtfelder }}
              </div>

          {% if review_status %}
          <div class="rating">
            <p>{% for i in 1..5 %}
              {% if rating < i %}<span class="fa fa-stack"><i class="fa fa-star-o fa-stack-1x"></i></span>{% else %}<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>{% endif %}
              {% endfor %} <a href="" onclick="$('a[href=\'#tab-review\']').trigger('click'); return false;">{{ reviews }}</a> / <a href="" onclick="$('a[href=\'#tab-review\']').trigger('click'); return false;">{{ text_write }}</a></p>
            <hr>
          </div>
          {% endif %} </div>
      </div>
      {% if products %}
      <h3>{{ text_related }}</h3>
      <div class="row"> {% set i = 0 %}
        {% for product in products %}
        {% if column_left and column_right %}
        {% set class = 'col-xs-8 col-sm-6' %}
        {% elseif column_left or column_right %}
        {% set class = 'col-xs-6 col-md-4' %}
        {% else %}
        {% set class = 'col-xs-6 col-sm-3' %}
        {% endif %}
        <div class="{{ class }}">
          <div class="product-thumb transition">
            <div class="image"><a href="{{ product.href }}"><img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive" /></a></div>
            <div class="caption">
              <h4><a href="{{ product.href }}">{{ product.name }}</a></h4>
              <p>{{ product.description }}</p>



              {% if product.rating %}
              <div class="rating"> {% for j in 1..5 %}
                {% if product.rating < j %} <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-1x"></i></span> {% else %} <span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span> {% endif %}
                {% endfor %} </div>
              {% endif %}
              {% if product.price %}
              <p class="price"> {% if not product.special %}
                {{ product.price }}
                {% else %} <span class="price-new">{{ product.special }}</span> <span class="price-old">{{ product.price }}</span> {% endif %}
                {% if product.tax %} <span class="price-tax">{{ text_tax }} {{ product.tax }}</span> {% endif %} </p>
              {% endif %} </div>
            <div class="button-group">
              <button type="button" onclick="cart.add('{{ product.product_id }}', '{{ product.minimum }}');"><span class="hidden-xs hidden-sm hidden-md">{{ button_cart }}</span> <i class="fa fa-shopping-cart"></i></button>
              <button type="button" data-toggle="tooltip" title="{{ button_wishlist }}" onclick="wishlist.add('{{ product.product_id }}');"><i class="fa fa-heart"></i></button>
              <button type="button" data-toggle="tooltip" title="{{ button_compare }}" onclick="compare.add('{{ product.product_id }}');"><i class="fa fa-exchange"></i></button>
            </div>
          </div>
        </div>


        {% if column_left and column_right and (i + 1) % 2 == 0 %}
        <div class="clearfix visible-md visible-sm"></div>
        {% elseif column_left or column_right and (i + 1) % 3 == 0 %}
        <div class="clearfix visible-md"></div>
        {% elseif (i + 1) % 4 == 0 %}
        <div class="clearfix visible-md"></div>
        {% endif %}
        {% set i = i + 1 %}
        {% endfor %} </div>
        {% endif %}
        {% if tags %}
        <p>{{ text_tags }}
        {% for i in 0..tags|length %}
        {% if i < (tags|length - 1) %} <a href="{{ tags[i].href }}">{{ tags[i].tag }}</a>,
        {% else %} <a href="{{ tags[i].href }}">{{ tags[i].tag }}</a> {% endif %}
        {% endfor %} </p>
        {% endif %}


      {{ content_bottom }}</div>
    {{ column_right }}</div>
</div>

<div id="akkuHinweis">
  <p>Möchten Sie Ihre Drohne wirklich ohne Akku kaufen?</p>
  <button value="ja" class="akkuHinweisButtons">Ja</button>
  <button value="nein" class="akkuHinweisButtons">Nein</button>
</div>

<script type="text/javascript"><!--
$('select[name=\'recurring_id\'], input[name="quantity"]').change(function(){
	$.ajax({
		url: 'index.php?route=product/product/getRecurringDescription',
		type: 'post',
		data: $('input[name=\'product_id\'], input[name=\'quantity\'], select[name=\'recurring_id\']'),
		dataType: 'json',
		beforeSend: function() {
			$('#recurring-description').html('');
		},
		success: function(json) {
			$('.alert-dismissible, .text-danger').remove();

			if (json['success']) {
				$('#recurring-description').html(json['success']);
			}
		}
	});
});
//--></script>
<script type="text/javascript">

<!--

function addEinkauf(){

  $.ajax({
    url: 'index.php?route=checkout/cart/add',
    type: 'post',
    data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),
    dataType: 'json',
    beforeSend: function() {
      $('#button-cart').button('loading');
    },
    complete: function() {
      $('#button-cart').button('reset');
    },
    success: function(json) {
      $('.alert-dismissible, .text-danger').remove();
      $('.form-group').removeClass('has-error');

      if (json['error']) {
        if (json['error']['option']) {
          for (i in json['error']['option']) {
            var element = $('#input-option' + i.replace('_', '-'));

            if (element.parent().hasClass('input-group')) {
              element.parent().after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
            } else {
              element.after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
            }
          }
        }

        if (json['error']['recurring']) {
          $('select[name=\'recurring_id\']').after('<div class="text-danger">' + json['error']['recurring'] + '</div>');
        }

        // Highlight any found errors
        $('.text-danger').parent().addClass('has-error');
      }

      if (json['success']) {
        $('.breadcrumb').after('<div class="alert alert-success alert-dismissible">' + json['success'] + '<button type="button" class="close" data-dismiss="alert">&times;</button></div>');

        $('html, body').animate({ scrollTop: 0 }, 'slow');

        $('#cart > ul').load('index.php?route=common/cart/info ul li');
      }
    },
        error: function(xhr, ajaxOptions, thrownError) {
            alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
        }
  });

}

/* Hinweisanzeige für fehlende Akkuauswahl */
var akkuOptions = document.querySelectorAll(".akkuOptions");
var importantAkkuOption = akkuOptions[0] ? akkuOptions[0] : "";
var importantAkkuOptionValue = importantAkkuOption.value;

var akkuButtons = document.querySelectorAll(".akkuHinweisButtons");

/* Akkubuttons
  0 = Ja
  1 = Nein
*/

akkuButtons[0].addEventListener("click", function(){
	var akkuHinweis = $("#akkuHinweis");
    var auswahl = this.value;

    if(auswahl == "ja"){
      addEinkauf();
      akkuHinweis.dialog("close");
    }

});

akkuButtons[1].addEventListener("click", function(){
   var akkuHinweis = $("#akkuHinweis");
   var auswahl = this.value;

   if(auswahl == "nein"){
     akkuHinweis.dialog("close");
   }

});

$('#button-cart').on('click', function() {
  var akkuHinweis = $("#akkuHinweis");
  var akkuFieldValue = $(".productAkku").val();

   akkuHinweis.dialog({
      autoOpen : false,
      modal : true,
      show : "blind",
      hide : "blind",

  });

  if(akkuOptions.length > 0){
    if(akkuFieldValue == "" || akkuFieldValue == importantAkkuOptionValue ){
      // Dialog
      akkuHinweis.dialog("open");

    } else{
      addEinkauf();
    }

  } else{
    addEinkauf();
  }

});
//--></script>
<script type="text/javascript"><!--
$('.date').datetimepicker({
	language: '{{ datepicker }}',
	pickTime: false
});

$('.datetime').datetimepicker({
	language: '{{ datepicker }}',
	pickDate: true,
	pickTime: true
});

$('.time').datetimepicker({
	language: '{{ datepicker }}',
	pickDate: false
});

$('button[id^=\'button-upload\']').on('click', function() {
	var node = this;

	$('#form-upload').remove();

	$('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>');

	$('#form-upload input[name=\'file\']').trigger('click');

	if (typeof timer != 'undefined') {
    	clearInterval(timer);
	}

	timer = setInterval(function() {
		if ($('#form-upload input[name=\'file\']').val() != '') {
			clearInterval(timer);

			$.ajax({
				url: 'index.php?route=tool/upload',
				type: 'post',
				dataType: 'json',
				data: new FormData($('#form-upload')[0]),
				cache: false,
				contentType: false,
				processData: false,
				beforeSend: function() {
					$(node).button('loading');
				},
				complete: function() {
					$(node).button('reset');
				},
				success: function(json) {
					$('.text-danger').remove();

					if (json['error']) {
						$(node).parent().find('input').after('<div class="text-danger">' + json['error'] + '</div>');
					}

					if (json['success']) {
						alert(json['success']);

						$(node).parent().find('input').val(json['code']);
					}
				},
				error: function(xhr, ajaxOptions, thrownError) {
					alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
				}
			});
		}
	}, 500);
});
//--></script>
<script type="text/javascript"><!--
$('#review').delegate('.pagination a', 'click', function(e) {
    e.preventDefault();

    $('#review').fadeOut('slow');

    $('#review').load(this.href);

    $('#review').fadeIn('slow');
});

$('#review').load('index.php?route=product/product/review&product_id={{ product_id }}');

$('#button-review').on('click', function() {
	$.ajax({
		url: 'index.php?route=product/product/write&product_id={{ product_id }}',
		type: 'post',
		dataType: 'json',
		data: $("#form-review").serialize(),
		beforeSend: function() {
			$('#button-review').button('loading');
		},
		complete: function() {
			$('#button-review').button('reset');
		},
		success: function(json) {
			$('.alert-dismissible').remove();

			if (json['error']) {
				$('#review').after('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
			}

			if (json['success']) {
				$('#review').after('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');

				$('input[name=\'name\']').val('');
				$('textarea[name=\'text\']').val('');
				$('input[name=\'rating\']:checked').prop('checked', false);
			}
		}
	});
});

$(document).ready(function() {
	$('.thumbnails').magnificPopup({
		type:'image',
		delegate: 'a',
		gallery: {
			enabled: true
		}
	});
});
//--></script>
{{ footer }}
Schöne Grüße

New member

Posts

Joined
Thu Sep 13, 2018 2:24 pm

Post by OSWorX » Wed Mar 17, 2021 2:56 pm

Stef97 wrote:
Tue Mar 16, 2021 11:24 pm
Hey,

danke für deine Rückmeldung. Ja... Das habe ich auch getan. Bisher noch keine Rückmeldung.

An dieser Stelle ist es nicht sinnvoll, ein endif oder endfor zu integrieren, da die notwendige Schleife unterbrochen wird und es logisch nicht zusammenpasst. Diese

Meinst du mit Code den Code vom Plugin selbst?
Soweit ich das auf die Schnelle sehe, liegt der Fehler an dem selbst hinzugefügten Code:

Code: Select all

{% if option.type == 'select' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <div class="row mb-3">
                <div class="col-md-9 col-sm-8 col-6 pr-3">
                  <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
                </div>
                
              </div>

              {% if option.name == "Akku" %}
                <select name="option[{{ option.product_option_id }}]" id="input-option{{ option.product_option_id }}" class="form-control productAkku">
                    <option value="">{{ text_select }}</option>
                    {% for option_value in option.product_option_value %}
                      <option value="{{ option_value.product_option_value_id }}" class="akkuOptions">{{ option_value.name }}
                    {% if option_value.price %}
                      ({{ option_value.price_prefix }}{{ option_value.price }})
                    {% endif %}
                    </option>
                    {% endfor %}
              </select>
              {% else %}
Einerseits wird gefragt:

Code: Select all

{% if option.type == 'select' %}
doch dann geht es so weiter:

Code: Select all

{% if option.name == "Akku" %}
Fehlt meiner Meinung nach:

Code: Select all

{% endif %}
oder

Code: Select all

{% else %}
je nachdem wie das Ganze im Endeffekt aufgebaut sein soll.

Und da hier anscheinend selber "angepasst" wurde, denke ich dass der Vorlagenhersteller kaum etwas dazu retour melden wird.
Zudem wäre es besser dann gleich einen vernünftigen Programmierer ran zu lassen.

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

Post by Stef97 » Thu Apr 01, 2021 12:36 am

Hi,

jetzt komme ich endlich dazu zu antworten.

Ich habe jetzt testweise die Standard product.twig eingefügt. Nun erscheint kein Fehler beim Aufruf der Produktseite nichtmehr aber das Plugin lässt sich, obwohl es aktiviert ist nicht aktivieren. Das mag komisch klingen. Mehr dazu in den folgenden Bildern.

Erweiterungen > Anpassungen
https://ibb.co/tB8YR00
Bei den Anpassungen wird angezeigt, dass das Plugin aktiv ist.

Erweiterungen > Module > Product Builder > Edit
https://ibb.co/86mR5kY
In den Generaleinstellungen habe ich das Plugin auch aktiviert.

Erweiterungen > Module
https://ibb.co/QNgM2kW
Hier ist aber zu sehen, dass obwohl das Plugin in den Gerneraleinstellungen aktiviert ist, nicht aktiviert wird.

Habt ihr sowas schonmal gehabt? Woran kann es liegen?

Schöne Grüße

New member

Posts

Joined
Thu Sep 13, 2018 2:24 pm

Post by Stef97 » Tue Apr 06, 2021 11:20 pm

Hey,

ich habe die letzten Tage viel rumgetestet und siehe da, der Fehler in der product.twig ist nun wieder in Zeile 199 vorhanden. Ich verwende nun aber die Source-Product.twig...

New member

Posts

Joined
Thu Sep 13, 2018 2:24 pm
Who is online

Users browsing this forum: No registered users and 1 guest