Skip to content

Commit

Permalink
rm override
Browse files Browse the repository at this point in the history
  • Loading branch information
cchalamon committed Jul 4, 2023
1 parent 551f95f commit c64b97e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 91 deletions.
29 changes: 24 additions & 5 deletions everpsvoucheronorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct()
{
$this->name = 'everpsvoucheronorder';
$this->tab = 'pricing_promotion';
$this->version = '2.2.4';
$this->version = '2.2.5';
$this->author = 'Team Ever';
$this->need_instance = 0;
$this->bootstrap = true;
Expand Down Expand Up @@ -365,8 +365,8 @@ protected function getConfigFormValues()
'ORDERVOUCHER_ENABLE' => Configuration::get('ORDERVOUCHER_ENABLE'),
'ORDERVOUCHER_MAIL' => Configuration::get('ORDERVOUCHER_MAIL'),
'ORDERVOUCHER_ZONES_TAX[]' => json_decode(Configuration::get('ORDERVOUCHER_ZONES_TAX')),
'ORDERVOUCHER_DETAILS' => Configuration::getConfigInMultipleLangs('ORDERVOUCHER_DETAILS'),
'ORDERVOUCHER_PREFIX' => Configuration::getConfigInMultipleLangs('ORDERVOUCHER_PREFIX'),
'ORDERVOUCHER_DETAILS' => self::getConfigInMultipleLangs('ORDERVOUCHER_DETAILS'),
'ORDERVOUCHER_PREFIX' => self::getConfigInMultipleLangs('ORDERVOUCHER_PREFIX'),
'ORDERVOUCHER_CATEGORY' => Tools::getValue(
'ORDERVOUCHER_CATEGORY',
json_decode(
Expand Down Expand Up @@ -515,8 +515,8 @@ public function hookActionValidateOrder($params)

public function createFirstVoucher($id_customer, $id_order)
{
$description = Configuration::getConfigInMultipleLangs('ORDERVOUCHER_DETAILS');
$prefixx = Configuration::getConfigInMultipleLangs('ORDERVOUCHER_PREFIX');
$description = self::getConfigInMultipleLangs('ORDERVOUCHER_DETAILS');
$prefixx = self::getConfigInMultipleLangs('ORDERVOUCHER_PREFIX');
$prefix = $prefixx[(int) $this->context->language->id];
$allowedTaxZones = json_decode(Configuration::get('ORDERVOUCHER_ZONES_TAX'));
$customer = new Customer((int) $id_customer);
Expand Down Expand Up @@ -664,4 +664,23 @@ public function createFirstVoucher($id_customer, $id_order)
$order_voucher->voucher_code = (string) $voucher_code;
return $order_voucher->save();
}

/**
* Get a single configuration value (in multiple languages).
* PS 1.7 backward compatibility
* @param string $key Configuration Key
* @param int $idShopGroup Shop Group ID
* @param int $idShop Shop ID
*
* @return array Values in multiple languages
*/
public static function getConfigInMultipleLangs($key, $idShopGroup = null, $idShop = null)
{
$resultsArray = [];
foreach (Language::getIDs() as $idLang) {
$resultsArray[$idLang] = Configuration::get($key, $idLang, $idShopGroup, $idShop);
}

return $resultsArray;
}
}
40 changes: 0 additions & 40 deletions override/classes/Configuration.php

This file was deleted.

28 changes: 0 additions & 28 deletions override/classes/index.php

This file was deleted.

18 changes: 0 additions & 18 deletions override/index.php

This file was deleted.

0 comments on commit c64b97e

Please sign in to comment.