Ergebnis 1 bis 6 von 6

Thema: Elementtyp "HTML" > Code wird nicht vollständig gespeichert

  1. #1
    Contao-Nutzer
    Registriert seit
    08.12.2010.
    Beiträge
    39

    Standard Elementtyp "HTML" > Code wird nicht vollständig gespeichert

    Hallo zusammen,

    für einen WebShop möchte ich auf der Bestellbestätigungsseite einen einfachen HTML-Code für den Trusted Shops Käuferschutz einbinden. Der Blanko-Code wird von Trusted Shops selber zur Verfügung gestellt und soll Shop-ID, Email des Kunden, Bestellsumme, etc in das darauf folgende Formular übertragen.

    So sieht dann der Code aus, nachdem ich die entsprechenden PHP-Zeilen eingefügt habe:

    HTML-Code:
    <table width="100%" border="0" cellspacing="0" cellpadding="10">
    <tr>
    <td width="90">
    <form name="formSiegel" method="post" action=
    "https://www.trustedshops.com/shop/certificate.php" target="_blank">
    <input type="image" border="0" src="http://laroma.de/testumgebung/tl_files/fotos/trusted_shops/TrustedShops-rgb-Siegel_90Hpx.png" title="Trusted Shops Gütesiegel - Bitte hier Gültigkeit prüfen!">
    <input name="shop_id" type="hidden" value="X05341948A8298216...">
    </form>
    </td>
    <td align="justify">
    <form id="formTShops" name="formTShops" method="post" action="https://www.trustedshops.com/shop/protection.php" target="_blank">
    <input name="_charset_" type="hidden" value="utf-8">
    <input name="shop_id" type="hidden" value="X05341948A8298216...">
    <input name="email" type="hidden" value="<?php echo $this->guest_billing_email; ?>">
    <input name="amount" type="hidden" value="<?php echo formatPrice($this->paymentSum, true); ?>">
    <input name="curr" type="hidden" value="EUR">
    <input name="paymentType" type="hidden" value="<?php echo $this->payment['title']; ?>">
    <input name="kdnr" type="hidden" value="0">
    <input name="ordernr" type="hidden" value="<?php echo $this->orderId; ?>">
    Als zus&auml;tzlichen Service bieten wir Ihnen den K&auml;uferschutz an. Wir &uuml;bernehmen alle Kosten dieser Garantie, Sie m&uuml;ssen sich lediglich anmelden.
    <br><br>
    <input type="submit" id="btnProtect" name="btnProtect"value="Anmeldung zum Trusted Shops Käuferschutz">
    </form>
    </td>
    </tr>
    </table>
    (Die Shop-ID ist natürlich vollständig und korrekt)

    Diesen Code füge ich dann auf der Bestellbestätigunsseite des Shops als Elementtyp "HTML" ein, doch dieser wird nicht vollständig gespeichert. Nur der erste Teil bis zur Zeile in der die Email Adresse abgefragt wird, wird nach dem Speichern noch im Editor angezeigt. (Siehe Screenshot)

    html-ts.png

    Stimmt mit meinem Code etwas nicht? In den Contao-Einstellungen habe ich bereits <value> <type> und <?php> als erlaubte HTML-Tags hinzugefügt. Fehlt da noch etwas? Oder funktioniert es nicht, weil generell PHP im Code enthalten ist? Ich bin leider nicht so fit in PHP...

    Freue mich über Hilfe!
    Danke und Grüße

  2. #2
    Contao-Urgestein Avatar von cliffparnitzky
    Registriert seit
    08.10.2010.
    Ort
    Lüneburg
    Beiträge
    2.452
    User beschenken
    Wunschliste
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Hmm,

    du versuchst ausführbaren Code (PHP) in ein HTML Element einzufügen?

    PHP-Code:
    <input name="email" type="hidden" value="<?php echo $this->guest_billing_email?>">
    Das wird nix werden.

    Gruß, Cliff

  3. #3
    Contao-Nutzer
    Registriert seit
    08.12.2010.
    Beiträge
    39

    Standard

    Wie schon gesagt, bin ich leider nicht fit in PHP...
    Was kann ich tun damit es funktioniert? Ich habe auch schon versucht, den HTML-Code in das Template der Bestellbestätigungsseite einzufügen, doch das hat die komplette Seite zerschossen.

    Das ist der Blanko-Code der von Trusted Shops als Vorlage zur Verfügung gestellt wird:

    HTML-Code:
    <table width=400 border="0" cellspacing="0" cellpadding="4">
    <tr>
    <td width="90">
    <form name="formSiegel" method="post" action=
    "https://www.trustedshops.com/shop/certificate.php" target="_blank">
    <input type="image" border="0" src="{pfad/zum/siegel.png}" title="Trusted Shops Gütesiegel - Bitte hier Gültigkeit prüfen!">
    <input name="shop_id" type="hidden" value="{value shop_id}">
    </form>
    </td>
    <td align="justify">
    <form id="formTShops" name="formTShops" method="post" action="https://www.trustedshops.com/shop/protection.php" target="_blank">
    <input name="_charset_" type="hidden" value="">
    <input name="shop_id" type="hidden" value="{value shop_id}">
    <input name="email" type="hidden" value="{value email}">
    <input name="amount" type="hidden" value="{value amount}">
    <input name="curr" type="hidden"value="{value curr}">
    <input name="paymentType" type="hidden" value="{value paymentType}">
    <input name="kdnr" type="hidden" value="{value kdnr}">
    <input name="ordernr" type="hidden" value="{value ordernr}">
    Als zus&auml;tzlichen Service bieten wir Ihnen den K&auml;uferschutz an. Wir &uuml;bernehmen alle Kosten dieser Garantie, Sie m&uuml;ssen sich lediglich anmelden.
    <br><br>
    <input type="submit" id="btnProtect" name="btnProtect"value="Anmeldung zum Trusted Shops Käuferschutz">
    </form>
    </td>
    </tr>
    </table>

  4. #4
    Contao-Urgestein Avatar von cliffparnitzky
    Registriert seit
    08.10.2010.
    Ort
    Lüneburg
    Beiträge
    2.452
    User beschenken
    Wunschliste
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Ja, also überall da wo nun geschweifte Klammern sind, muss ein Wert rein.

    Guck dir mal die Contao Inserttags an ... z.B. {{user::email}}

    Manche werte musst du bestimmt fest setzen.

    Gruß, Cliff

  5. #5
    Contao-Nutzer
    Registriert seit
    08.12.2010.
    Beiträge
    39

    Standard

    Ok, danke! Das bringt mich schonmal weiter.
    Die Insert-Tags für den WebShop finde ich dort natürlich nicht, habe aber gerade mal die Entwickler angeschrieben ob die mir diese nennen können.
    Ich gebe bescheid wie es ausgegangen ist!

  6. #6
    Contao-Nutzer
    Registriert seit
    08.12.2010.
    Beiträge
    39

    Standard

    So, für den WebShop gibts laut Entwickler keine Inserttags außer den (drei) die hier zu finden sind: http://www.contao-webshop.de/inserttags.html

    Also hilft das nicht weiter. Ich habe nun den Code in das Template (webShop_orderCompleted.xhtml) eingefügt, dort sollten PHP-Abfragen ja auf jeden Fall laufen. So schauts aus:

    HTML-Code:
    <table width="100%" border="0" cellspacing="0" cellpadding="10">
    <tr>
    <td width="90">
    <form name="formSiegel" method="post" action=
    "https://www.trustedshops.com/shop/certificate.php" target="_blank"/>
    <input type="image" border="0" src="http://laroma.de/testumgebung/tl_files/fotos/trusted_shops/TrustedShops-rgb-Siegel_90Hpx.png" title="Trusted Shops Gütesiegel - Bitte hier Gültigkeit prüfen!"/>
    <input name="shop_id" type="hidden" value="X05341948A8298216D..."/>
    </form>
    </td>
    <td align="justify">
    <form id="formTShops" name="formTShops" method="post" action="https://www.trustedshops.com/shop/protection.php" target="_blank"/>
    <input name="_charset_" type="hidden" value="utf-8"/>
    <input name="shop_id" type="hidden" value="X05341948A82982..." />
    <input name="email" type="hidden" value="<?php echo $this->guest_billing_email;?>" />
    <input name="amount" type="hidden" value="<?php echo ($this->paymentSum);?>" />
    <input name="curr" type="hidden" value="EUR">
    <input name="paymentType" type="hidden" value="<?php echo $this->payment['title'];?>" />
    <input name="kdnr" type="hidden" value="0" />
    <input name="ordernr" type="hidden" value="<?php echo $this->orderId; ?>" />
    Als zus&auml;tzlichen Service bieten wir Ihnen den K&auml;uferschutz an. Wir &uuml;bernehmen alle Kosten dieser Garantie, Sie m&uuml;ssen sich lediglich anmelden.
    <br><br>
    <input type="submit" id="btnProtect" name="btnProtect"value="Anmeldung zum Trusted Shops Käuferschutz"/>
    </form>
    </td>
    </tr>
    </table>
    Funktioniert natürich trotzdem noch nicht. Die PHP-Schnippsel habe ich mir aus diesem Template (webShop_checkoutConfirm.xhtml) gezogen:

    HTML-Code:
    <div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
    
      <?php if ($this->headline): ?>
        <<?php echo $this->hl; ?>><?php echo $this->headline; ?></<?php echo $this->hl; ?>>
      <?php endif; ?>
      
      <div class="shoppingOverview">
        <ul class="heading">
          <li class="articleName"><?php print $GLOBALS['TL_LANG']['webShop']['lbl_article']; ?></li>
          <li class="articleQTY"><?php print $GLOBALS['TL_LANG']['webShop']['lbl_qty']; ?></li>
          <li class="articlePrice"><?php print $GLOBALS['TL_LANG']['webShop']['lbl_singlePrice']; ?></li>
          <li class="articleSum"><?php print $GLOBALS['TL_LANG']['webShop']['lbl_priceSum']; ?></li>
        </ul>
    		<div style="clear: both;"></div>
    		
      	<?php if(count($this->items)): $x = 1; foreach($this->items as $item): $x++; ?>
    		  <ul class="item_<?php print ($x % 2 ? 'odd' : 'even'); ?>">
    	      <li class="articleName">
    	      	<?php print $item->title; ?>
    			<?php if($item->type == 'articleVariants'): print ' - '. $item->subtitle; endif; ?><br/><?php print $item->teaser; ?>
    			<?php if($item->allowComment && strlen($item->comment)): print '<div class="itemComment">'. $item->comment; ?></div><?php endif;?>
    				</li>
    	      <li class="articleQTY"><?php print $item->qty; ?></li>
    	      <li class="articlePrice"><?php print formatPrice($item->price, true); ?></li>
    	      <li class="articleSum"><?php print formatPrice($item->sum, true); ?></li>
    	    </ul>
    			<div style="clear: both;"></div>
        <?php endforeach; endif; ?>
    		
      	<ul class="shoppingTotal">
    			<li class="articlePriceLabel"><?php print $GLOBALS['TL_LANG']['webShop']['subtotal']; ?></li>
    			<li class="articlePriceValue"><?php print formatPrice($this->articleSum, true); ?></li>
    		</ul>  	
    		<div style="clear: both;"></div>
    		
      </div>
    	<div class="discountOverview">
        <div class="coupons">
          <?php if(count($this->coupons)): foreach($this->coupons as $coupon): ?>
          <ul>
            <?php if(stristr($coupon['amount'], '%')): ?>
            	<li class="couponLabel"><?php print $coupon['code']; ?> <?php print $coupon['amount']; ?></li>
            	<li class="couponValue"><?php print formatPrice($coupon['value'], true); ?></li>
            <?php else: ?>
            	<li class="couponLabel"><?php print $coupon['code']; ?></li>
            	<li class="couponValue"><?php print formatPrice($coupon['amount'], true); ?></li>
            <?php endif; ?>
          </ul>
          <?php endforeach; ?>
            <ul class="shoppingTotal">
              <li class="articlePriceLabel"><?php print $GLOBALS['TL_LANG']['webShop']['subtotal']; ?></li>
              <li class="articlePriceValue"><?php print formatPrice($this->articleSumCoupon, true); ?></li>
            </ul>   
          <?php endif; ?>
          <div class="clean"></div>
        </div>
        
        <div class="discounts">
          <?php if(count($this->discounts)): foreach($this->discounts as $discount): ?>
            <ul>
              <li class="discountLabel"><?php print $discount[0]; ?></li>
              <li class="discountValue"><?php print formatPrice($discount[1], true); ?></li>
            </ul>
          <?php endforeach; endif; ?>
          <div class="clean"></div>
        </div>
      </div>
      
    	<div class="shippingOverview">
    		<ul>
    			<?php if($this->shipping['shippingPriceType'] != 'shippingInfo'): ?>
    				<li class="shippingLabel"><?php print $GLOBALS['TL_LANG']['webShop']['shippingMethod']; ?>: <?php print $this->shipping['title']; ?></li>
    				<li class="shippingPrice"><?php print formatPrice($this->shipping['shippingFee'], true); ?></li>
    			<?php else: ?>
    			  <li class="shippingLabel"><?php print $GLOBALS['TL_LANG']['webShop']['shippingMethod']; ?>: <?php print $this->shipping['shippingInfo']; ?></li>
            <li class="shippingPrice">-</li>
    			<?php endif; ?>
    		</ul>
    		<div class="clean"></div>
    	</div>
    	
    	<div class="paymentOverview">
    		<ul>
    			<li class="paymentLabel"><?php print $GLOBALS['TL_LANG']['webShop']['paymentMethod']; ?>: <?php print $this->payment['title']; ?></li>
    			<li class="paymentPrice"><?php print formatPrice($this->payment['paymentFee'], 2); ?></li>
    		</ul>
    		<div class="clean"></div>
    	</div>
    	
    	
    	<div class="overviewTotal">
    	  <ul>
    	    <li class="totalLabel"><?php print $GLOBALS['TL_LANG']['webShop']['lbl_total']; ?></li>
    		  <li class="totalValue"><?php print formatPrice($this->sum, true); ?></li>
    		</ul>
    		<div class="clean"></div>
    		<div class="taxes">
    			<?php if($this->calcBrutto && count($this->taxes)): foreach($this->taxes as $tax): if($tax['sum'] == 0) continue; ?>
    			  <ul>
    			  	<li class="taxLabel"><?php print $this->taxExInc .' '. ($tax['tax_rate']  * 1); ?>% <?php print $GLOBALS['TL_LANG']['webShop']['tax']; ?></li>
    					<li class="taxSum"><?php print formatPrice($tax['sum'], true); ?></li>
    			  </ul>
    				<div class="clean"></div>
    			<?php endforeach; endif; ?>
    		</div>
    	  <ul class="overviewBilling">
    	    <li class="billingLabel"><?php print $GLOBALS['TL_LANG']['webShop']['billingValue']; ?></li>
    			<li class="billingValue"><?php print formatPrice($this->paymentSum, true); ?></li>
    	  </ul>
    		<div class="clean"></div>
      </div>
    	
      <div class="addresses">
    	  <div class="billingAddress">
          <b><?php print $GLOBALS['TL_LANG']['webShop']['billingAddress']; ?></b><br/>
          <?php if($this->paymentAddress['company']): ?>
          <?php print $this->paymentAddress['company']; ?><br/>
          <?php endif; ?>
          <?php printf('%s %s<br/>%s<br/>%s-%s %s<br/>', $this->paymentAddress['firstname'], $this->paymentAddress['lastname'], $this->paymentAddress['street'], ucfirst($this->paymentAddress['country']), $this->paymentAddress['postal'], $this->paymentAddress['city']); ?>
        </div>
      	<div class="shippingAddress">
      		<b><?php print $GLOBALS['TL_LANG']['webShop']['shippingAddress']; ?></b><br/>
      		<?php if($this->shippingAddress['company']): ?>
    			<?php print $this->shippingAddress['company']; ?><br/>
    			<?php endif; ?>
    			<?php printf('%s %s<br/>%s<br/>%s-%s %s<br/>', $this->shippingAddress['firstname'], $this->shippingAddress['lastname'], $this->shippingAddress['street'], ucfirst($this->shippingAddress['country']), $this->shippingAddress['postal'], $this->shippingAddress['city']); ?>
        </div>
    		<div class="clean"></div>
    	</div>	
    
    		
    	<div class="checkoutConfirm">
    		<form action="<?php print $this->href; ?>" method="post" id="frmCheckoutConfirm">
    			<input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}"/>
    	    <div class="customerComment">
    	    	<b><?php print $GLOBALS['TL_LANG']['webShop']['customerMsg']; ?>:</b><br/>
    	      <textarea name="customerMessage" class="customerCommentArea"><?php print $this->customerMessage; ?></textarea>
    	    </div>
    			
    			<div class="agbText">
    	      <?php print $this->agbText; ?>
    	    </div>
    		<div>
    			<?php if($this->agbwarn): ?>
    			  <p class="error"><?php print $GLOBALS['TL_LANG']['webShop']['checkout_error']['terms']; ?></p>
    			<?php endif; ?>
    			<input class="arc" type="checkbox" id="agb" name="agb" value="agb"<?php print $this->agbChecked ? ' checked="checked"' : ''; ?>><label for="agb">Allgemeine Geschäftsbedingungen akzeptiert</label><br/>
    			<?php if($this->cancellationwarn): ?>
    			  <p class="error"><?php print $GLOBALS['TL_LANG']['webShop']['checkout_error']['cancellation']; ?></p>
    			<?php endif; ?>
    		  <input class="arc" type="checkbox" id="cancellation" name="cancellation"<?php print $this->cancellationChecked ? ' checked="checked"' : ''; ?>/><label for="cancellation">Widerrufsbelehrung anerkannt</label>
          </div>
    	  <div class="checkOut"> 
    			<input type="hidden" name="FORM_ACTION" value="submitOrder"/>
    			
    			<span class="button_left"><input class="submit" type="button" onclick="window.location.href='<?php print $this->lnkBack['href']; ?>';" value="‹ <?php print $this->lnkBack['title']; ?>"/></span>
    			<span class="button_right"><input type="submit" class="submit" value="<?php print $GLOBALS['TL_LANG']['webShop']['btn_orderConfirm']; ?> ›"/></span>
          </div>
    		</form>
    	</div>
    	
    	
      <script type="text/javascript">
    		<!--//--><![CDATA[//><!--
    			window.addEvent('domready', function() {
    	      initARC('frmCheckoutConfirm', false, false, 'checkboxOn', 'checkboxOff');
    			});
    		//--><!]]>
      </script>
    </div>
    Ist das grundsätzlich richtig? Oder was mache ich falsch?
    Geändert von fips (24.02.2014 um 17:52 Uhr)

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Lesezeichen

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •