Bardzo Was wszystkich proszę o pomoc, po złożeniu zamówień w naszym sklepie metodą bankwire po akceptowaniu zamówienia odpowiednim buttonem zamówienie owszem, dodaje się do bazy Prestashop i jest przyjęta, jednak klient po akceptacji zostaje przekierowany na białą stronę.
Na tą stronę także zostaje przekierowany użytkownik, który wybierze w module PayU płatność przelelwem.
Poniżej umieszczam pliki źródłowe:
validation.php (modules/bankwire/)
include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/../../header.php');
include(dirname(__FILE__).'/bankwire.php');
$context = Context::getContext();
$cart = $context->cart;
$bankwire = new BankWire();
if ($cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$bankwire->active)
Tools::redirect('index.php?controller=order&step=1');
// Check that this payment option is still available in case the customer changed his address just before the end of the checkout process
$authorized = false;
foreach (Module::getPaymentModules() as $module)
if ($module['name'] == 'bankwire')
{
$authorized = true;
break;
}
if (!$authorized)
die($bankwire->l('This payment method is not available.', 'validation'));
$customer = new Customer((int)$cart->id_customer);
if (!Validate::isLoadedObject($customer))
Tools::redirect('index.php?controller=order&step=1');
$currency = $context->currency;
$total = (float)($cart->getOrderTotal(true, Cart::BOTH));
$bankwire->validateOrder($cart->id, Configuration::get('PS_OS_BANKWIRE'), $total, $bankwire->displayName, NULL, array(), (int)$currency->id, false, $customer->secure_key);
$order = new Order($bankwire->currentOrder);
Tools::redirect('index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$bankwire->id.'&id_order='.$bankwire->currentOrder.'&key='.$customer->secure_key);
Question
pawlus1993
Witam serdecznie wszystkich forumowiczów
Bardzo Was wszystkich proszę o pomoc, po złożeniu zamówień w naszym sklepie metodą bankwire po akceptowaniu zamówienia odpowiednim buttonem zamówienie owszem, dodaje się do bazy Prestashop i jest przyjęta, jednak klient po akceptacji zostaje przekierowany na białą stronę.
Strona na którą uzytkownik zostaje przekierowany: http://allforyou.pl/order-confirmation?id_cart=2477&id_module=188&id_order=300&key=c16f771974b1ce73115de2161f830c7b (biała strona, bez żadnego kodu i informacji )
Na tą stronę także zostaje przekierowany użytkownik, który wybierze w module PayU płatność przelelwem.
Poniżej umieszczam pliki źródłowe:
validation.php (modules/bankwire/)
include(dirname(__FILE__).'/../../config/config.inc.php'); include(dirname(__FILE__).'/../../header.php'); include(dirname(__FILE__).'/bankwire.php'); $context = Context::getContext(); $cart = $context->cart; $bankwire = new BankWire(); if ($cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$bankwire->active) Tools::redirect('index.php?controller=order&step=1'); // Check that this payment option is still available in case the customer changed his address just before the end of the checkout process $authorized = false; foreach (Module::getPaymentModules() as $module) if ($module['name'] == 'bankwire') { $authorized = true; break; } if (!$authorized) die($bankwire->l('This payment method is not available.', 'validation')); $customer = new Customer((int)$cart->id_customer); if (!Validate::isLoadedObject($customer)) Tools::redirect('index.php?controller=order&step=1'); $currency = $context->currency; $total = (float)($cart->getOrderTotal(true, Cart::BOTH)); $bankwire->validateOrder($cart->id, Configuration::get('PS_OS_BANKWIRE'), $total, $bankwire->displayName, NULL, array(), (int)$currency->id, false, $customer->secure_key); $order = new Order($bankwire->currentOrder); Tools::redirect('index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$bankwire->id.'&id_order='.$bankwire->currentOrder.'&key='.$customer->secure_key);payment_execcution.tpl (themes/modules/bankwire)
{capture name=path}{l s='Bank-wire payment.' mod='bankwire'}{/capture} <h2>{l s='Order summary' mod='bankwire'}</h2> {assign var='current_step' value='payment'} {include file="$tpl_dir./order-steps.tpl"} {if $nbProducts <= 0} <p class="warning">{l s='Your shopping cart is empty.' mod='bankwire'}</p> {else} <h3 class="title1">{l s='Bank-wire payment.' mod='bankwire'}</h3><br/> <form action="{$link->getModuleLink('bankwire', 'validation', [], true)|escape:'html'}" method="post"> <p> <img src="{$this_path_bw}bankwire.jpg" alt="{l s='Bank wire' mod='bankwire'}" width="86" height="49" style="float:left; margin: 0px 10px 5px 0px;" /> {l s='You have chosen to pay by bank wire.' mod='bankwire'} <br/><br /> {l s='Here is a short summary of your order:' mod='bankwire'} </p> <table id="cart_summary" class="std"> <caption style="margin-bottom: 10px; align: center;"><font style="font-weight: bold; color: #f44d00; font-size: 16px; align: center;">SZCZEGÓŁY TWOJEGO ZAMÓWIENIA</font></caption> <thead> <tr> <th class="cart_product first_item">{l s='Produkt'}</th> <th class="cart_availability item">{l s='Kod'}</th> <th class="cart_unit item">{l s='Cena jednostkowa'}</th> <th class="cart_quantity item">{l s='Ilość'}</th> <th class="cart_total last_item">{l s='Razem'}</th> </tr> </thead> <tfoot> {if $use_taxes} {if $priceDisplay} <tr class="cart_total_price"> <td colspan="4">{if $display_tax_label}{l s='Total products (tax excl.)'}{else}{l s='Total products'}{/if}</td> <td class="price" id="total_product">{displayPrice price=$total_products}</td> </tr> {else} <tr class="cart_total_price"> <td colspan="4">{if $display_tax_label}{l s='Cena za produkty (brutto)'}{else}{l s='Total products'}{/if}</td> <td class="price" id="total_product">{displayPrice price=$total_products_wt}</td> </tr> <tr class="cart_total_price"> <td colspan="4">{if $display_tax_label}{l s='Koszty wysyłki (brutto)'}{else}{l s='Total products'}{/if}</td> <td class="price" id="total_product">{displayPrice price=$total_price - $total_products_wt}</td> </tr> {/if} {else} <tr class="cart_total_price"> <td><b><font style="font-size: 14px;">{l s='KOŃCOWE PODSUMOWANIE TWOJEGO ZAMÓWIENIA'}</b></td> <td colspan="4">{l s='Total products'}</td> <td class="price" id="total_product">{displayPrice price=$total_products}</td> </tr> {/if} <tr class="cart_total_voucher" {if $total_wrapping == 0}style="display:none"{/if}> <td colspan="4"> {if $use_taxes} {if $priceDisplay} {if $display_tax_label}{l s='Total gift wrapping (tax excl.):'}{else}{l s='Total gift wrapping cost:'}{/if} {else} {if $display_tax_label}{l s='Total gift wrapping (tax incl.)'}{else}{l s='Total gift wrapping cost:'}{/if} {/if} {else} {l s='Total gift wrapping cost:'} {/if} </td> <td class="price-discount price" id="total_wrapping"> {if $use_taxes} {if $priceDisplay} {displayPrice price=$total_wrapping_tax_exc} {else} {displayPrice price=$total_wrapping} {/if} {else} {displayPrice price=$total_wrapping_tax_exc} {/if} </td> </tr> {if $total_shipping_tax_exc <= 0 && !isset($virtualCart)} <tr class="cart_total_delivery"> <td colspan="4">{l s='Shipping:'}</td> <td class="price" id="total_shipping">{l s='Free Shipping!'}</td> </tr> {else} {if $use_taxes && $total_shipping_tax_exc != $total_shipping} {if $priceDisplay} <tr class="cart_total_delivery" {if $shippingCost <= 0} style="display:none"{/if}> <td colspan="4">{if $display_tax_label}{l s='Total shipping (tax excl.)'}{else}{l s='Total shipping'}{/if}</td> <td class="price" id="total_shipping">{displayPrice price=$shippingCostTaxExc}</td> </tr> {else} <tr class="cart_total_delivery"{if $shippingCost <= 0} style="display:none"{/if}> <td colspan="4">{if $display_tax_label}{l s='Total shipping (tax incl.)'}{else}{l s='Total shipping'}{/if}</td> <td class="price" id="total_shipping" >{displayPrice price=$shippingCost}</td> </tr> {/if} {else} <tr class="cart_total_delivery"{if $shippingCost <= 0} style="display:none"{/if}> <td colspan="4">{l s='Total shipping'}</td> <td class="price" id="total_shipping" >{displayPrice price=$shippingCostTaxExc}</td> </tr> {/if} {/if} <tr class="cart_total_voucher" {if $total_discounts == 0}style="display:none"{/if}> <td colspan="4"> {if $use_taxes} {if $priceDisplay} {if $display_tax_label}{l s='Total vouchers (tax excl.)'}{else}{l s='Total vouchers'}{/if} {else} {if $display_tax_label}{l s='Total vouchers (tax incl.)'}{else}{l s='Total vouchers'}{/if} {/if} {else} {l s='Total vouchers'} {/if} </td> <td class="price-discount price" id="total_discount"> {if $use_taxes} {if $priceDisplay} {displayPrice price=$total_discounts_tax_exc*-1} {else} {displayPrice price=$total_discounts*-1} {/if} {else} {displayPrice price=$total_discounts_tax_exc*-1} {/if} </td> </tr> {if $use_taxes} {if $priceDisplay && $total_tax != 0} <tr class="cart_total_tax"> <td colspan="4">{l s='Total tax:'}</td> <td class="price" id="total_tax" >{displayPrice price=$total_tax}</td> </tr> {/if} <tr class="cart_total_price"> <td colspan="4" id="cart_voucher" class="cart_voucher"> {if $voucherAllowed} {if isset($errors_discount) && $errors_discount} <ul class="error"> {foreach from=$errors_discount key=k item=error} <li>{$error|escape:'htmlall':'UTF-8'}</li> {/foreach} </ul> {/if} {/if} <font style="font-size: 17px; color: #1A982F;">{l s='Razem do zapłaty:'}</font> </td> <td colspan="2" class="price total_price_container" id="total_price_container"> <span>{displayPrice price=$total_price}</span> </td> </tr> {else}<tr></tr> <tr class="cart_total_price"> <td colspan="4" id="cart_voucher" class="cart_voucher"> {if $voucherAllowed} <div id="cart_voucher" class="table_block"> {if isset($errors_discount) && $errors_discount} <ul class="error"> {foreach from=$errors_discount key=k item=error} <li>{$error|escape:'htmlall':'UTF-8'}</li> {/foreach} </ul> {/if} {if $voucherAllowed} <form action="{if $opc}{$link->getPageLink('order-opc', true)}{else}{$link->getPageLink('order', true)}{/if}" method="post" id="voucher"> <fieldset> <p class="title_block"><label for="discount_name">{l s='Vouchers'}</label></p> <p> <input type="text" id="discount_name" name="discount_name" value="{if isset($discount_name) && $discount_name}{$discount_name}{/if}" /> </p> <p class="submit"><input type="hidden" name="submitDiscount" /><input type="submit" name="submitAddDiscount" value="{l s='ok'}" class="csbutton cssecond" /></p> {if $displayVouchers} <p id="title" class="title_offers">{l s='Take advantage of our offers:'}</p> <div id="display_cart_vouchers"> {foreach from=$displayVouchers item=voucher} <span onclick="$('#discount_name').val('{$voucher.name}');return false;" class="voucher_name">{$voucher.name}</span> - {$voucher.description} <br /> {/foreach} </div> {/if} </fieldset> </form> {/if} </div> {/if} </td> <td colspan="2" class="price total_price_container" id="total_price_container"> <p><font style="font-size: 17px; color: #1A982F;">{l s='Razem do zapłaty:'}</font></p> <span id="total_price">{displayPrice price=$total_price_without_tax}</span> </td> </tr> {/if} </tfoot> <tbody> {foreach from=$products item=product name=productLoop} {assign var='productId' value=$product.id_product} {assign var='productAttributeId' value=$product.id_product_attribute} {assign var='quantityDisplayed' value=0} {assign var='cannotModify' value=1} {assign var='odd' value=$product@iteration%2} {assign var='noDeleteButton' value=1} {* Display the product line *} {include file="$tpl_dir./shopping-cart-product-line.tpl"} {* Then the customized datas ones*} {if isset($customizedDatas.$productId.$productAttributeId)} {foreach from=$customizedDatas.$productId.$productAttributeId[$product.id_address_delivery] key='id_customization' item='customization'} <tr id="product_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}" class="alternate_item cart_item"> <td colspan="4"> {foreach from=$customization.datas key='type' item='datas'} {if $type == $CUSTOMIZE_FILE} <div class="customizationUploaded"> <ul class="customizationUploaded"> {foreach from=$datas item='picture'} <li> <img src="{$pic_dir}{$picture.value}_small" alt="" class="customizationUploaded" /> </li> {/foreach} </ul> </div> {elseif $type == $CUSTOMIZE_TEXTFIELD} <ul class="typedText"> {foreach from=$datas item='textField' name='typedText'} <li> {if $textField.name} {l s='%s:' sprintf=$textField.name} {else} {l s='Text #%s:' sprintf=$smarty.foreach.typedText.index+1} {/if} {$textField.value} </li> {/foreach} </ul> {/if} {/foreach} </td> <td class="cart_quantity"> {if isset($cannotModify) AND $cannotModify == 1} <span style="float:left">{if $quantityDisplayed == 0 AND isset($customizedDatas.$productId.$productAttributeId)}{$customizedDatas.$productId.$productAttributeId|@count}{else}{$product.cart_quantity-$quantityDisplayed}{/if}</span> {else} <div style="float:right"> <a rel="nofollow" class="cart_quantity_delete" id="{$product.id_product}_{$product.id_product_attribute}_{$id_customization}" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_customization={$id_customization}&token={$token_cart}")|escape:'html'}"><img src="{$img_dir}icon/delete.gif" alt="{l s='Delete'}" title="{l s='Delete this customization'}" width="11" height="13" class="icon" /></a> </div> <div id="cart_quantity_button" style="float:left"> <a rel="nofollow" class="cart_quantity_up" id="cart_quantity_up_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}" href="{$link->getPageLink('cart', true, NULL, "add=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_customization={$id_customization}&token={$token_cart}")|escape:'html'}" title="{l s='Add'}"><img src="{$img_dir}icon/quantity_up.gif" alt="{l s='Add'}" width="14" height="9" /></a><br /> {if $product.minimal_quantity < ($customization.quantity -$quantityDisplayed) OR $product.minimal_quantity <= 1} <a rel="nofollow" class="cart_quantity_down" id="cart_quantity_down_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}" href="{$link->getPageLink('cart', true, NULL, "add=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_customization={$id_customization}&op=down&token={$token_cart}")|escape:'html'}" title="{l s='Subtract'}"> <img src="{$img_dir}icon/quantity_down.gif" alt="{l s='Subtract'}" width="14" height="9" /> </a> {else} <a class="cart_quantity_down" style="opacity: 0.3;" id="cart_quantity_down_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}" href="#" title="{l s='Subtract'}"> <img src="{$img_dir}icon/quantity_down.gif" alt="{l s='Subtract'}" width="14" height="9" /> </a> {/if} </div> <input type="hidden" value="{$customization.quantity}" name="quantity_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}_hidden"/> <input size="2" type="text" value="{$customization.quantity}" class="cart_quantity_input" name="quantity_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}"/> {/if} </td> <td class="cart_total"></td> </tr> {assign var='quantityDisplayed' value=$quantityDisplayed+$customization.quantity} {/foreach} {* If it exists also some uncustomized products *} {if $product.quantity-$quantityDisplayed > 0}{include file="$tpl_dir./shopping-cart-product-line.tpl"}{/if} {/if} {/foreach} {assign var='last_was_odd' value=$product@iteration%2} {foreach $gift_products as $product} {assign var='productId' value=$product.id_product} {assign var='productAttributeId' value=$product.id_product_attribute} {assign var='quantityDisplayed' value=0} {assign var='odd' value=($product@iteration+$last_was_odd)%2} {assign var='ignoreProductLast' value=isset($customizedDatas.$productId.$productAttributeId)} {assign var='cannotModify' value=1} {* Display the gift product line *} {include file="./shopping-cart-product-line.tpl" productLast=$product@last productFirst=$product@first} {/foreach} </tbody> {if count($discounts)} <tbody> {foreach from=$discounts item=discount name=discountLoop} <tr class="cart_discount {if $smarty.foreach.discountLoop.last}last_item{elseif $smarty.foreach.discountLoop.first}first_item{else}item{/if}" id="cart_discount_{$discount.id_discount}"> <td class="cart_discount_name" colspan="2">{$discount.name}</td> <td class="cart_discount_description" colspan="3">{$discount.description}</td> <td class="cart_discount_price"> <span class="price-discount"> {if $discount.value_real > 0} {if !$priceDisplay} {displayPrice price=$discount.value_real*-1} {else} {displayPrice price=$discount.value_tax_exc*-1} {/if} {/if} </span> </td> </tr> {/foreach} </tbody> {/if} </table> <!-- <p style="margin-top:20px;"> - {l s='The total amount of your order is' mod='bankwire'} <span id="amount" class="price">{displayPrice price=$total}</span> {if $use_taxes == 1} {l s='(tax incl.)' mod='bankwire'} {/if} </p> <p> </p>--> {if $currencies|@count > 1} {l s='We allow several currencies to be sent via bank wire.' mod='bankwire'} <br /><br /> {l s='Choose one of the following:' mod='bankwire'} <select id="currency_payement" name="currency_payement" onchange="setCurrency($('#currency_payement').val());"> {foreach from=$currencies item=currency} <option value="{$currency.id_currency}" {if $currency.id_currency == $cust_currency}selected="selected"{/if}>{$currency.name}</option> {/foreach} </select> {else} {l s='We allow the following currency to be sent via bank wire:' mod='bankwire'} <b>{$currencies.0.name}</b> <input type="hidden" name="currency_payement" value="{$currencies.0.id_currency}" /> {/if} <p> {l s='Bank wire account information will be displayed on the next page.' mod='bankwire'} <br /><br /> <b>{l s='Please confirm your order by clicking "Place my order."' mod='bankwire'}.</b> </p> <p class="cart_navigation"> <a href="{$link->getPageLink('order', true, NULL, "step=3")|escape:'html'}" class="csbutton cssecond">{l s='Other payment methods' mod='bankwire'}</a> <input type="submit" name="submit" value="{l s='Place my order' mod='bankwire'}" class="csbutton csdefault" /> </p> </form> {/if}Wersja Prestashop 1.6.0.6
Szablon Electronues
Adres sklepu: www.allforyou.pl
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now