Jump to content

SlimDeluxe

Members
  • Posts

    3
  • Joined

  • Last visited

SlimDeluxe's Achievements

Newbie

Newbie (1/14)

  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

1

Reputation

  1. 1.6.1.24 naj bi odpravil ta problem. Za dodatno zaščito pa lahko spremenite "login" URL v Nastavitve > SEO & URLs
  2. Hi, I am having problems with attaching content to the displayAdminOrder hook. It displays just fine when I open the order (see attachment #1). But when I press the Capture button in a form I have, the resulting page is missing all the content from the view order page that appears before this hook is called (attachment #2). If I re-open the order it again displays normally. I tried displayAdminOrderLeft too, with the same results... (everything before it is cut off) I've check Paymill and PayPal modules and they basicall use the code to display the TPL, so I am really lost why does it not work for me. Here's my hook public function hookdisplayAdminOrder($params) { if (! $this->active) { return; } $id_order = (int)$params['id_order']; /* @var $order OrderCore */ $order = new Order($id_order); if (! Validate::isLoadedObject($order) || $order->module !== $this->name) { return; } if (Tools::isSubmit('megapos_capture')) { $tx_code = Tools::getValue('tx_code'); if ($tx_code) { $tx = Transaction::fetchByCode($tx_code); if (Validate::isLoadedObject($tx)) { try { $client = MegaposTools::getClient(); $params = array( 'store-id' => MegaposTools::getStoreParam(), 'transaction-id' => $tx->tx_code, 'amount' => $tx->amount ); $rs = $client->processTransaction($params); $tx->setState($rs->{'active-state'}->type); if ($tx->state === 'PROCESSED') { $msg = $this->l('Funds successfully captured!'); $msg_error = false; } else { $msg = $this->l('Could not capture funds.') .' '. $this->l('Error returned by processing centre: '); $msg_error = true; } } catch (Exception $ex) { $msg = $this->l('Could not capture funds.') .' '. $this->l('Initialization error: '). $ex->getMessage(); $msg_error = true; } $this->context->smarty->assign(array( 'megapos_msg' => $msg, 'megapos_error' => $msg_error )); } } } $this->context->smarty->assign(array( 'list_tx' => Transaction::fetchListByOrderId($order->id) )); return $this->display(__FILE__, 'admin_vieworder_tx.tpl'); } And here's the TPL: <div id="formTransactionsPanel" class="panel"> <div class="panel-heading"> <i class="icon-credit-card"></i> {l s="Transactions"} <span class="badge">{$list_tx|@count}</span> </div> {if isset($megapos_msg)} <div class="alert {if ! $megapos_error}alert-success{else}alert-danger{/if}"> {$megapos_msg} </div> {/if} <div class="table-responsive"> <table class="table"> <thead> <tr> <th><span class="title_box ">{l s='Date'}</span></th> <th><span class="title_box ">{l s='Transaction ID' mod=megapos}</span></th> <th><span class="title_box ">{l s='Amount'}</span></th> <th><span class="title_box ">{l s='State'}</span></th> <th><span class="title_box ">{l s='Updated'}</span></th> <th></th> </tr> </thead> <tbody> {foreach $list_tx as $tx} <tr class="{if $tx->isPending()}warning{elseif $tx->hasFailed()}danger{/if}"> <td>{dateFormat date=$tx->date_add full=true}</td> <td>{$tx->tx_code}</td> {*<td>{$payment->transaction_id|escape:'html':'UTF-8'}</td>*} <td>{displayPrice price=$tx->amount currency=$tx->getCurrencyId()}</td> <td>{$tx->state}</td> <td> {if $tx->date_upd} {dateFormat date=$tx->date_upd full=true} {else} ∅ {/if} </td> <td class="actions"> <form method="POST"> <input name="tx_code" type="hidden" value="{$tx->tx_code}"/> {if $tx->needsCapture()} <button name="megapos_capture" class="btn btn-success" type="submit" onclick="if (!confirm('{l s='Are you sure you want to capture the specified amount?' mod=megapos}'))return false;"> <i class="icon-check"></i> {l s='Capture' mod=megapos} </button> {/if} </form> </td> </tr> {foreachelse} <tr> <td class="list-empty hidden-print" colspan="6"> <div class="list-empty-msg"> <i class="icon-warning-sign list-empty-icon"></i> {l s='No transactions have been initialized' mod=megapos} </div> </td> </tr> {/foreach} </tbody> </table> </div> </div>
  3. Hi everyone, I am setting up a shop for my client and I have encountered a weird problem in the back office. I have tax rules correctly set up and it works fine in the frontend. The rule is: 22% tax for clients from EU countries, no tax for anyone else (this is the rule set that is imported from the Localization import tool). However now when edit a product, the tax calculation does not work, because it thinks there's no tax. See the attachment. How can I make Prestashop Back office use the rule for ie. Slovenia (where the seller is located)?
×
×
  • Create New...