thanks for sharing. I will test it .[/QUOTE
did it work? and im wondering if its the latest
private function _postProcess() {
if (Tools::isSubmit('submitInitialConditions') && !Configuration::get('REWARDS_INITIAL_CONDITIONS')) {
// import existing loyalty
if (Tools::getValue('loyalty_import'))
RewardsModel::importFromLoyalty();
// import existing sponsorship
if (Tools::getValue('advancedreferralprogram_import'))
RewardsSponsorshipModel::importFromReferralProgram(true);
else if (Tools::getValue('referralprogram_import'))
RewardsSponsorshipModel::importFromReferralProgram();
// import existing fancoupon
if (Tools::getValue('fbpromote_import'))
RewardsFacebookModel::importFromFbpromote();
// inactive old modules
$modules = array('loyalty', 'advancedreferralprogram', 'referralprogram', 'fbpromote');
foreach($modules as $tmpmod) {
if (Module::isInstalled($tmpmod) && $mod=Module::getInstanceByName($tmpmod))
$mod->disable();
}
Configuration::updateValue('REWARDS_INITIAL_CONDITIONS', 1);
$this->confirmation = $this->displayConfirmation($this->l('The module has been initialized.'));
} else if (Tools::isSubmit('submitRegistration') && Tools::getValue('rewards_registration')) {
Configuration::updateValue('REWARDS_REGISTRATION', Tools::getValue('rewards_registration'));
} else if (Tools::isSubmit('submitNewVersion') && Configuration::get('REWARDS_REGISTRATION')) {
$data = array('{registration}' => Configuration::get('REWARDS_REGISTRATION'), '{module_version}' => $this->version, '{ps_version}' => _PS_VERSION_);
$this->sendMail($this->context->language->id, 'asknewversion', $this->l('New version of the module'), $data, 'contact@prestaplugins.com', 'Prestaplugins');
}
}
// display news and check if a new version is available
private function _getXmlRss() {
$html = '';
$bError = false;
$data = array('version' => $this->version, 'registration' => Configuration::get('REWARDS_REGISTRATION'), 'email' => Configuration::get('PS_SHOP_EMAIL'), 'asknewversion' => Tools::isSubmit('submitNewVersion') ? 1 : 0);
$request = http_build_query($data, '', '&');
if (function_exists('curl_init') && $ch = @curl_init('www.prestaplugins.com/news/allinone_rewards.php')) {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_REFERER, $_SERVER['HTTP_HOST']);
$response = @curl_exec($ch);
@curl_close($ch);
} else if (ini_get('allow_url_fopen')) {
if ($fp = @fsockopen('http://www.prestaplugins.com', 80, $errno, $errstr, 50)){
fputs($fp, "GET /news/allinone_rewards.php HTTP/1.0\r\n");
fputs($fp, "Host: www.prestaplugins.com\r\n");
fputs($fp, "Referer: ".$_SERVER['HTTP_HOST']."\r\n");
fputs($fp, "Connection: close\r\n");
$response = '';
while (!feof($fp))
$response .= fgets($fp, 1024);
fclose($fp);
} else
$bError = true;
} else
$bError = true;
if ($bError) {
$html .= '<div style="font-weight: bold; color: red">'.$this->l('You need to enable CURL extension or fsockopen, to be informed about new version of the module').'</div>';
} else if (!empty($response)) {
$doc = new DOMDocument('1.0', 'UTF-8');
@$doc->loadXML($response);
$version = $doc->getElementsByTagName('version')->item(0)->nodeValue;
$registered = (int)$doc->getElementsByTagName('registered')->item(0)->nodeValue;
$asknewversion = (int)$doc->getElementsByTagName('asknewversion')->item(0)->nodeValue;
$newslist = $doc->getElementsByTagName('news');
if ($registered == -1) {
Configuration::updateValue('REWARDS_REGISTRATION', '');
$html .= '<div style="margin-left: 10%; font-weight: bold; color: red">'.$this->l('Your order reference was not valid, please try again.').'</div>';
}
if ($registered < 1) {
if (Configuration::get('REWARDS_REGISTRATION') != '') {
$html .= '<div style="margin-left: 10%; margin-bottom: 20px; font-weight: bold">'.$this->l('Thanks for your patience, your license is being validated.').'</div>';
} else {
$html .= '
<div style="margin-left: 10%; margin-bottom: 20px;">'.
$this->l('Please register by entering your order reference. This way, if you are eligible for further updates you will be able to claim for them automatically.').'<br/>
<form id="rewards_registration_form" method="post">
<input type="text" id="rewards_registration" name="rewards_registration" value="'.Configuration::get('REWARDS_REGISTRATION').'">
<input type="submit" name="submitRegistration" class="button" value="'.$this->l('Register').'">
</form>
</div>';
}
} else
$html .= '<div style="margin-left: 10%; font-weight: bold">'.$this->l('Congratulation, your license is registered.').'</div>';
$html .= '<div style="margin-left: 10%; margin-bottom: 20px"><b>'.$this->l('Your version :').' '.$this->version.'</b>';
if (version_compare($this->version, $version, '>='))
$html .= '<span style="color: green; font-weight: bold; display: inline-block; margin-left: 20px">'.$this->l('You are currently using the last version of this module').'</span>';
else {
$html .= '<span style="color: red; font-weight: bold; display: inline-block; margin-left: 20px">'.$this->l('A new version of this module is available').' - '.$this->l('Version').' '.$version.'</span>';
if ($registered && !$asknewversion) {
$html .= '
<form method="post" style="display: inline; padding-left: 10px">
<input class="button" type="submit" name="submitNewVersion" value="'.$this->l('Ask for the new version').'">
</form>';
JUST RECIEVED:Allows your customers to earn rewards, all grouped into a single account, while developing SEO and reputation of your shop: loyalty program, sponsorship (multilevel, self-promotional), affiliation, facebook and more.
Your sales will really increase !
Get tons of new customers and increase your brand reputation thanks to the All-in-one Rewards module !
This module allows to set up a complete system of rewards in your shop to increase SEO and reputation thanks to the virality of the system, and to follow very precisely the performance.
View attachment 759
DEMO: https://addons.prestashop.com/es/pr...e-rewards-fidelidad-padrinaje-afiliacion.html
Grettings.
Thank u so muchAllows your customers to earn rewards, all grouped into a single account, while developing SEO and reputation of your shop: loyalty program, sponsorship (multilevel, self-promotional), affiliation, facebook and more.
Your sales will really increase !
Get tons of new customers and increase your brand reputation thanks to the All-in-one Rewards module !
This module allows to set up a complete system of rewards in your shop to increase SEO and reputation thanks to the virality of the system, and to follow very precisely the performance.
View attachment 759
DEMO: https://addons.prestashop.com/es/pr...e-rewards-fidelidad-padrinaje-afiliacion.html
Grettings.