Hinweis: ======== Die einzelnen Sequenzen, Codes usw. sind immer mit "#####" vorangestellt und abgeschlossen! Das Beispiel ist unter Windows7-Dateisystem gezeigt! xxxx steht für den eigenen Windowsbenutzernamen. Zeta-Producer muss beendet sein! Anpassung: ========== Öffnen der Datei "C:\Users\xxxx\Documents\Zeta Producer 10\Stationary\DEU\Scripting\ServerSideScripting\PHP\shop\classes\controller.php" mit dem Notepad: Austausch der Sequenz "case 'sendOrder'" durch folgenden Code: ##### case 'sendOrder': $error = ShopManager::ValidateAddressFormInput( $this->request); // If no error occurred send the order if(empty($error)) { ShopManager::SendOrderEmail( $this->request, Model::GetArticles()); if ($this->request['payment_method'] == 'paypal') { $this->DisplayPayPal( $this->request, $view, Model::GetArticles()); } else { session_unset(); $view->SetTemplate('ordersent'); } } else { $this->AttachAddressFormView( $this->request, $view, $error); $this->DisplayBasket( $this->request, $view, false, false, 'sendOrder'); } break; ##### Hinzufügen folgender Funktion in die gleiche Datei: ##### /** * Displays the PayPal-Callsite * * @param Array * @param View * @param Articles. */ public function DisplayPayPal( $request, $view, $articles) { $view->SetTemplate('paypalordersent'); foreach($articles as $article) { $total_sum += $article->sumPrice; } if (Configuration::$conf_shippingcosts > 0) { $total_sum += Configuration::$conf_shippingcosts; } $view->Assign('paypal_cmd', "_xclick" ); $view->Assign('paypal_business', Configuration::$conf_shopemail ); $view->Assign('paypal_item_name', Configuration::$conf_shopname . ' - Bestellung vom ' . date( 'd.m.Y H:i' ) . ' fuer ' . trim( $request['name'] ) ); $view->Assign('paypal_amount', $total_sum ); $view->Assign('paypal_currency_code', Configuration::$conf_currency ); } ##### Speichern und schließen Sie die Datei controller.php! Öffnen der Datei "C:\Users\xxxx\Documents\Zeta Producer 10\Stationary\DEU\Scripting\ServerSideScripting\PHP\shop\classes\shopmanager.php" mit dem Notepad: Austausch der Sequenz "public function GetPaymentMethodText" durch folgenden Code: ##### public function GetPaymentMethodText( $paymentMethod) { // Translation not implemented yet. switch($paymentMethod) { case 'paypal': return 'PayPal'; case 'delivery': return 'Nachnahme'; case 'advance': return 'Vorkasse (Überweisung)'; case 'bill': return 'Rechnung'; default: return 'Vorkasse (Überweisung)'; } } ##### Austausch der Sequenz "public function AssignShopConfiguration" durch folgenden Code: ##### public function AssignShopConfiguration( $view) { $view->Assign('conf_shopName', Configuration::$conf_shopname); $view->Assign('conf_shopEmail', Configuration::$conf_shopemail); $view->Assign('conf_shippingCosts', Configuration::$conf_shippingcosts); $view->Assign('conf_currency', Configuration::$conf_currency); $view->Assign('conf_curr_comma', Configuration::$conf_curr_comma); $view->Assign('conf_curr_thousands', Configuration::$conf_curr_thousands); $view->Assign('conf_curr_decimals', Configuration::$conf_curr_decimals); $view->Assign('conf_payment_advance',Configuration::$conf_payment_advance); $view->Assign('conf_payment_bill', Configuration::$conf_payment_bill); $view->Assign('conf_payment_delivery', Configuration::$conf_payment_delivery); $view->Assign('conf_payment_paypal', Configuration::$conf_payment_paypal); $view->Assign('conf_page_agb', Configuration::$conf_page_agb); $view->Assign('conf_basketUrl', Configuration::$conf_basketurl); } ##### Speichern und schließen Sie die Datei shopmanager.php! Öffnen der Datei "C:\Users\xxxx\Documents\Zeta Producer 10\Stationary\DEU\Scripting\ServerSideScripting\PHP\shop\templates\addressform.php" mit dem Notepad: Suchen nach der Sequenz "if($this->_['conf_payment_advance'])" und Austausch mit folgendem Code: ##### _['conf_payment_paypal']) { echo('_['form_input']['payment_method'] == 'paypal') echo 'checked="checked"'; echo('>PayPal
'); } if($this->_['conf_payment_advance']) { echo('_['form_input']['payment_method'] == 'advance') echo 'checked="checked"'; echo('>Vorkasse (Überweisung)
'); } if($this->_['conf_payment_bill']) { echo('_['form_input']['payment_method'] == 'bill') echo 'checked="checked"'; echo('>Rechnung
'); } if($this->_['conf_payment_delivery']) { echo('_['form_input']['payment_method'] == 'delivery') echo 'checked="checked"'; echo('>Nachnahme'); } ?> ##### Speichern und schließen Sie die Datei addressform.php! Kopieren der Datei "C:\Users\xxxx\Documents\Zeta Producer 10\Stationary\DEU\Scripting\ServerSideScripting\PHP\shop\templates\ordersent.php" und umbenennen nach "C:\Users\xxxx\Documents\Zeta Producer 10\Stationary\DEU\Scripting\ServerSideScripting\PHP\shop\templates\paypalordersent.php", dann mit Notepad öffnen und mit folgendem Code ersetzen: #####

Vielen Dank!

Ihre Bestellung wurde abgesendet.

Sie erhalten umgehend eine Bestellbestätigung per E-Mail.


Bitte bezahlen Sie gleich hier direkt über PayPal:

##### Speichern und schließen Sie die Datei paypalordersent.php! Öffnen der Datei "C:\Users\xxxx\Documents\Zeta Producer 10\Stationary\DEU\ActiveObjects\template.xml" mit dem Notepad Suchen nach folgendem Inhalt: articlestyle="Warenkorb / Onlineshop-Konfiguration" markieren des kompletten Items und ersetzen durch folgenden Inhalt: ##### <$ if Context.Scope.CurrentArticle.Name <> "" then $>#data(name)<$ end if $> #text(PHP_ArticleStandardBegin) <$ if Context.Scope.CurrentPage.FileType = ".php" then $> <$$ ' BEGINN - Make shop configuration public PhpConfigFilePath public PhpShopIncFilePath sub CreateShopConfig() dim configFileName configFileName = "config.inc.php" dim configFilePath configFilePath = Context.Scope.Library.CombinePath( _ Context.Scope.Library.ExpandDollarMacros("$(WebOutputBaseFolder)"), _ "/media/Scripting/ServerSideScripting/PHP/shop" ) configFilePath = Context.Scope.Library.CombinePath( configFilePath, configFileName ) configFilePath = Replace( configFilePath, "/", "\") dim configFolderPath configFolderPath = Context.Scope.CurrentWebProject.GetPathFromFullFilePath( configFilePath ) dim fso set fso = CreateObject("Scripting.FileSystemObject") if not fso.FolderExists( configFolderPath ) then CreateFolder( configFolderPath ) end if dim configFileRelativePathV configFileRelativePathV = "/media/Scripting/ServerSideScripting/PHP/shop/" & configFileName dim configFilePathV configFilePathV = Context.Scope.CurrentWebProject.GetRelativePathFromTo( _ Context.Scope.CurrentPage.VirtualPath, _ "/media/Scripting/ServerSideScripting/PHP/shop/" & configFileName ) dim configFileRelativePathFtpV configFileRelativePathFtpV = _ Context.Scope.CurrentWebProject.FtpServerFolderName & _ Context.Scope.Library.LTrimEx(configFileRelativePathV, "/") dim configFilePathFtpV configFilePathFtpV = Context.Scope.Library.CombinePathV( _ Context.Scope.CurrentWebProject.FtpServerFolderName, _ configFilePathV ) configFilePathFtpV = Context.Scope.Library.LTrimEx(configFilePathFtpV, "/") configFilePathV = "/" & Context.Scope.Library.LTrimEx(configFilePathV, "/") dim file set file = fso.CreateTextFile(configFilePath, true) file.WriteLine("") file.Close set file = nothing ' Add to publishing chain. Context.Scope.CurrentWebProject.NotifyFileCreated( configFilePath ) set fso = nothing ' The path for the PHP is somewhat different. PhpConfigFilePath = Context.Scope.Library.LTrimEx(configFilePathV, "/") PhpShopIncFilePath = Context.Scope.CurrentWebProject.GetRelativePathFromTo( _ Context.Scope.CurrentPage.AbsoluteUrlWithoutServer, _ "/media/Scripting/ServerSideScripting/PHP/shop/shop.inc.php") end sub ' END - Make shop configuration $> <$ CreateShopConfig() $> "); ?> <$ else Context.Scope.Library.CheckAsyncStopProcessing Context.Scope.Library.LogError "Falschen Dateityp vergeben. Bitte vergeben Sie in den Seiteneigenschaften dieser Seite den Dateityp "".php""" end if $> #text(PHP_ArticleStandardEnd) #text(ArticleSeparator) <$ ' Special workaround to get out some http headers before content is sent to the client dim text text = """""" Context.Scope.AddScriptToRunOnFinishedPage( "<" & "$Context.Write(" & text & " & vbCrLf & Context.Scope.RenderedText )$" & ">" ) $>]]> ##### Speichern und schließen Sie die Datei template.xml! Nun müssen Sie noch die Datei "C:\Users\xxxx\Documents\Zeta Producer 10\Stationary\DEU\ActiveObjects\web.mdb" mit Microsoft Access öffnen. Öffnen Sie die Tabelle "ArticleStyle". Scrollen Sie herunter bis zum Eintrag "Warenkorb / Onlineshop-Konfiguration" in der Spalte "Name". Markieren Sie in dieser Zeile den kompletten Inhalt von "FieldDefs" und ersetzen Sie diesen mit folgendem Code: ##### ##### Schließen Sie die Tabelle wieder und danach Microsoft Access. Die Änderungen wurden jetzt in die web.mdb übernommen. Starten Sie nun den Zeta-Producer und öffnen Sie in ihrem Projekt den Warenkorb-Artikel. Hier gibt es nun eine Option "Zahlung per PayPal erlauben". Häkchen aktivieren und Schließen. Webprojekt komplett neu erstellen und veröffentlichen. Nun gibt es bei der Option "PayPal"-Zahlung in dem Emailbestätigungsfenster einen PayPal-Link-Button der direkt zur Paypal-Bezahlseite linkt mit dem aktuellen Warenkorb.