✏️ 正在编辑: recurringPayment.php
路径:
/home/bpioifn/www/pigmentse/modules/axepta/controllers/front/recurringPayment.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php /** * 1961-2019 BNP Paribas * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) that is available * through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0 * If you are unable to obtain it through the world-wide-web, please send an email * to modules@quadra-informatique.fr so we can send you a copy immediately. * * @author Quadra Informatique <modules@quadra-informatique.fr> * @copyright 1961-2019 BNP Paribas * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ class AxeptaRecurringPaymentModuleFrontController extends ModuleFrontController { /** Assign template vars related to page content * @see FrontController::initContent() */ public function initContent() { parent::initContent(); $payment_recurring_list = AxeptaCustomerPaymentRecurring::getAllRecurringPayment($this->context->customer->id); if (is_array($payment_recurring_list)) { foreach ($payment_recurring_list as $key => $value) { $recurrent_payment = new AxeptaCustomerPaymentRecurring($value['id_axepta_customer_payment_recurring']); $payment_recurring_list[$key]['late'] = (int)$recurrent_payment->getLateRecurringOccurence(); $payment_recurring_list[$key]['status'] = AxeptaCustomerPaymentRecurring::getStatus($value['status']); $payment_recurring_list[$key]['can_change_card'] = false; if ($value['status'] == AxeptaCustomerPaymentRecurring::ID_STATUS_PAUSE || $value['status'] == AxeptaCustomerPaymentRecurring::ID_STATUS_ACTIVE) { $payment_recurring_list[$key]['can_change_card'] = true; } else { $payment_recurring_list[$key]['late'] = 0; } $payment_recurring_list[$key]['item_name'] = Product::getProductName($value['id_product']); $product = new Product($value['id_product']); $order = new Order($value['id_order']); $currency = new Currency($order->id_currency); $payment_recurring_list[$key]['amount_tax_exclude'] = $recurrent_payment->amount_tax_exclude.' '.$currency->getSign(); $payment_recurring_list[$key]['item_reference'] = $order->reference; $payment_recurring_list[$key]['link_rewrite'] = $product->link_rewrite[$this->context->language->id]; $payment_recurring_list[$key]['item_image'] = 0; $images = $product->getImages($this->context->language->id); if (is_array($images)) { foreach ($images as $image) { if ($image['cover'] == 1) { $payment_recurring_list[$key]['item_image'] = $image['id_image']; continue; } } } } } $can_stop = AxeptaCustomerPaymentRecurring::hasOneInState($this->context->customer->id, AxeptaCustomerPaymentRecurring::ID_STATUS_ACTIVE); $can_change_card = AxeptaCustomerPaymentRecurring::hasOneInState($this->context->customer->id, AxeptaCustomerPaymentRecurring::ID_STATUS_PAUSE); $link = new Link(); $this->context->smarty->assign(array( 'payment_recurring_list' => $payment_recurring_list, 'url' => $link->getModuleLink('axepta', 'recurringPayment'), 'can_stop' => $can_stop, 'can_change_card' => $can_change_card, )); $this->setTemplate('module:axepta/views/templates/front/recurring_payment.tpl'); } public function postProcess() { $conf = false; if (Tools::isSubmit('axepta_stop_recurring_unique_form')) { $schedule = new AxeptaCustomerPaymentRecurring(Tools::getValue('id_axepta_customer_recurring_payment')); if ($schedule->status == 1) { $schedule->status = AxeptaCustomerPaymentRecurring::ID_STATUS_PAUSE; } else { $schedule->status = AxeptaCustomerPaymentRecurring::ID_STATUS_ACTIVE; } $schedule->save(); $conf = true; } $this->context->smarty->assign(array( 'display_conf' => $conf, )); } }
💾 保存文件
← 返回文件管理器