유효성 검사 코드를 실행하여 새 창을 여는 데 도움이 필요합니다. 것은 다음 PHP 파일이 실행될 때 필요하다는 것입니다.PrestaShop을 사용하여 PHP로 새 창 열기
<?php
class hhpaymentvalidationModuleFrontController extends ModuleFrontController
{
/**
* Validation du paiement standard
* Puis redirection vers la page de succès de commande
*/
public function postProcess()
{
$cart = $this->context->cart;
$this->abrir("http://davivienda.com");
// 0abrir("http://davivienda.com");
if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) {
Tools::redirect('index.php?controller=order&step=1');
}
$customer = new Customer($cart->id_customer);
if (!Validate::isLoadedObject($customer)) {
Tools::redirect('index.php?controller=order&step=1');
}
$currency = $this->context->currency;
$total = (float)$cart->getOrderTotal(true, Cart::BOTH);
//La command passe directement en statut payé
$this->module->validateOrder((int)$cart->id, Configuration::get('PS_OS_PAYMENT'), $total, $this->module->displayName, null, array(), (int)$currency->id, false, $customer->secure_key);
Tools::redirect('index.php?controller=order-confirmation&id_cart='.(int)$cart->id.'&id_module='.(int)$this->module->id.'&id_order='.$this->module->currentOrder.'&key='.$customer->secure_key);
}
public function abrir($param)
{
echo '<script type="text/javascript">';
echo "window.open('{$param}', 'ventana1', 'scrollbars=0, width=300, height=300')";
echo '</script>';
}
}
에 오신 것을 환영합니다 새로운 창을 열려면 jQuaery를 사용! 더 많은 사람들이 당신을 이해할 수 있도록 영어로 제목을 번역했습니다. 나는 또한 당신의 철자 중 일부를 수정하고 "좋은 친구", "도와주세요"및 반복 된 구와 같은 질문에서 불필요한 텍스트를 제거했습니다. 문제가 무엇이며 게시 된 코드가 작동하지 않는 이유에 대한 자세한 설명을 통해 질문을 업데이트 할 수 있습니다. 오류가 발생합니까? – agrm