He he he ... hej,
no fakt, problem niestety polega na tym, że nigdzie, żadnych errorów nie widzę, przeglądałem
wszystko co potrafię sam zlokalizować w tej kwestii i NIC.
Sprawdziłem też działanie skryptu. Jeśli na sztywno podstawię dane, część skryptu która odpowiada za zapisanie tychże do zaby działa jak należy jedynie nie wysyła maila do 'świeżo' zarejestrowanego użytkownika sklepu a powinien

Sam moduł żeby działać potrzebuje vqmod, sprawdziłem czy działa vqmod i najwyraźniej działa bo inne moduły które też tego wymagają działają bez problemu. Jedynie lbcoupon nie chce

Składa się ten moduł z kilku plików z czego najważniejszy jest plik xml z którego instrukcje są przepisywane do odpowiednich skryptów.
oto on lbcoupon.xml
<?xml version="1.0" encoding="UTF-8"?>
-<modification>
<id>Generate Coupon on Registration</id>
<version>1.0.0</version>
<vqmver>2.3.0</vqmver>
<author>BJaBakaL</author>
-<file name="catalog/controller/account/register.php">
-<operation>
-<search position="after">
<![CDATA[ $this->model_account_customer->addCustomer($this->request->post); ]]>
</search>
-<add>
<![CDATA[ $config_lbcoupon = $this->config->get( 'lbcoupon_vibhag' ); $lbcoupon_type = $config_lbcoupon['discount_type']; $lbcoupon_amount = (empty($config_lbcoupon['discount_amount'])) ? '0' : $config_lbcoupon['discount_amount']; $lbcoupon_duration = (empty($config_lbcoupon['discount_duration'])) ? '15' : $config_lbcoupon['discount_duration']; if($config_lbcoupon['status']) { $couponcode = substr(number_format(time() * rand(),0,'',''),0,10); $this->db->query("INSERT INTO " . DB_PREFIX . "coupon SET name = 'Discount For " . $this->request->post['email'] . "', code = '" . $couponcode . "', discount = '" . $lbcoupon_amount . "', type = '" . $lbcoupon_type . "', total = '1000000.0000', logged = '1', shipping = '1', date_start = NOW(), date_end = CURDATE() + INTERVAL $lbcoupon_duration DAY, uses_total = '1', uses_customer = '1', status = '1', date_added = NOW()"); if($lbcoupon_type == 'F') { //$message = sprintf('You can take Discount 5 USD . Just Appy this Coupon code : '.$couponcode, $this->config->get('config_name')) . "\n\n"; $message = "You can take USD $lbcoupon_amount Discount on any purchase". "\n\n"; $message .= "Just Appy this Coupon code : $couponcode"; } else { $message = "You can take $lbcoupon_amount % Discount on any purchase". "\n\n"; $message .= "Just Appy this Coupon code : $couponcode"; } $subject = sprintf('Thanks for Registering with us and We will Give Discount For You ', $this->config->get('config_name')); $to = $this->request->post['email']; $sender_name = $this->config->get('config_name'); $sender_email = $this->config->get('config_email'); $headers = array(); $headers[] = "MIME-Version: 1.0"; $headers[] = "Content-type: text/plain; charset=iso-8859-1"; $headers[] = "From: $sender_name <$sender_email>"; $headers[] = "Bcc: Mastah <roberta@uznam.net.pl>"; $headers[] = "Reply-To: $to <$sender_email>"; $headers[] = "Subject: {$subject}"; $headers[] = "X-Mailer: PHP/".phpversion(); mail($to, $subject, $message, implode("\r\n", $headers)); } ]]>
</add>
</operation>
</file>
</modification>
i php
<?php
class ControllerModuleLbCoupon extends Controller {
private $error = array();
public function index() {
$this->language->load('module/lbcoupon');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('lbcoupon', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'));
}
$this->data['text_enabled'] = $this->language->get('text_enabled');
$this->data['text_disabled'] = $this->language->get('text_disabled');
$this->data['heading_title'] = $this->language->get('heading_title');
$this->data['entry_title'] = $this->language->get('entry_title');
$this->data['entry_discount_duration'] = $this->language->get('entry_discount_duration');
$this->data['entry_discount_amount'] = $this->language->get('entry_discount_amount');
$this->data['entry_status'] = $this->language->get('entry_status');
$this->data['entry_discount_type'] = $this->language->get('entry_discount_type');
$this->data['button_save'] = $this->language->get('button_save');
$this->data['button_cancel'] = $this->language->get('button_cancel');
$this->data['entry_module_title'] = $this->language->get( 'entry_module_title' );
$this->data['tab_module'] = $this->language->get('tab_module');
$this->data['entry_image_navigator'] = $this->language->get( 'entry_image_navigator' );
if (isset($this->error['warning'])) { $this->data['error_warning'] = $this->error['warning'];
} else {
$this->data['error_warning'] = '';
}
$this->data['breadcrumbs'] = array();
$this->data['breadcrumbs'][] = array( 'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
'separator' => false
);
$this->data['breadcrumbs'][] = array( 'text' => $this->language->get('text_module'),
'href' => $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'),
'separator' => ' :: '
);
$this->data['breadcrumbs'][] = array( 'text' => $this->language->get('heading_title'),
'href' => $this->url->link('module/lbcoupon', 'token=' . $this->session->data['token'], 'SSL'),
'separator' => ' :: '
);
$this->data['action'] = $this->url->link('module/lbcoupon', 'token=' . $this->session->data['token'], 'SSL');
$this->data['cancel'] = $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL');
$this->data['token'] = $this->session->data['token'];
$this->data['modules'] = array();
if (isset($this->request->post['lbcoupon_vibhag'])) { $this->data['modules'] = $this->request->post['lbcoupon_vibhag'];
} elseif ($this->config->get('lbcoupon_vibhag')) {
$this->data['modules'] = $this->config->get('lbcoupon_vibhag');
}
$this->template = 'module/lbcoupon.tpl';
'common/header',
'common/footer'
);
$this->response->setOutput($this->render());
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'module/lbcoupon')) {
$this->error['warning'] = $this->language->get('error_permission');
}
if (!$this->error) {
return true;
} else {
return false;
}
}
}
?>
Wyciąłem fragment wysyłający maila, wkleiłem do osobnego pliku. odpaliłem i wysłało więc na serwerze mailer działa. Jedynie nie mogę doszukać się problemu w tym właśnie pliku, dlaczego nie działa