Jump to content

Gyakutsuki

♥Ambassador
  • Content count

    727
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by Gyakutsuki

  1. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    you have a problem with this : <script data-rocketsrc="ext/api/mailchimp_v3/mailchimp_v3.js" type="text/rocketscript"> </script> and must to be <script src="ext/api/mailchimp_v3/mailchimp_v3.j"> </script> please activate the debug, I can see the result
  2. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    You must to update the html content in function your needs In includes/modules/content/footer/template you find this : maybe not updated for BS <div class="clearfix"></div> <div class="ContentText footer_mailchimp"> <div class="row col-md-12"> <div class="col-md-3"></div> <div class="col-md-2"><h4><?php echo MODULE_FOOTER_MAILCHIMP_TEXT; ?></h4></div> <div class="col-md-3"> <?php echo $form; if (!empty(MODULES_HEADER_TAGS_MAILCHIMP_LIST_CUSTOMERS)) { echo tep_draw_input_field('lastname', NULL, 'class="form-control" required aria-required="true" required="" id="lname" placeholder="' . ENTRY_LAST_NAME . '"'); echo tep_draw_input_field('firstname', NULL, 'class="form-control" required aria-required="true" required="" id="fname" placeholder="' . ENTRY_FIRST_NAME . '"'); echo tep_draw_input_field('email', NULL, 'required id="email" placeholder="' . ENTRY_EMAIL_ADDRESS . '"', 'email'); echo tep_draw_button(MODULE_FOOTER_MAILCHIMP_SUBMIT, null, null, 'success','id="SendButton','xs') } elseif (!empty(MODULES_HEADER_TAGS_MAILCHIMP_LIST_ANONYMOUS)) { echo tep_draw_input_field('email', NULL, 'required id="email" placeholder="' . ENTRY_EMAIL_ADDRESS . '"', 'email'); echo tep_draw_button(MODULE_FOOTER_MAILCHIMP_SUBMIT, null, null, 'success','id="SendButton','xs') . tep_draw_hidden_field('anonymous', 'anonymous'); } echo $endform; ?> </div> <div><span class="message" id="message"><span></div> </div> </div> try this : <div class="clearfix"></div> <div class="ContentText footer_mailchimp"> <div><h4><?php echo MODULE_FOOTER_MAILCHIMP_TEXT; ?></h4></div> <?php echo $form; if (!empty(MODULES_HEADER_TAGS_MAILCHIMP_LIST_CUSTOMERS)) { echo tep_draw_input_field('lastname', NULL, 'class="form-control" required aria-required="true" required="" id="lname" placeholder="' . ENTRY_LAST_NAME . '"') . ' '; echo tep_draw_input_field('firstname', NULL, 'class="form-control" required aria-required="true" required="" id="fname" placeholder="' . ENTRY_FIRST_NAME . '"'). ' '; echo tep_draw_input_field('email', NULL, 'required id="email" placeholder="' . ENTRY_EMAIL_ADDRESS . '"', 'email'). ' '; echo tep_draw_button(MODULE_FOOTER_MAILCHIMP_SUBMIT, null, null, 'success','id="SendButton','xs'). ' '; } elseif (!empty(MODULES_HEADER_TAGS_MAILCHIMP_LIST_ANONYMOUS)) { echo tep_draw_input_field('email', NULL, 'required id="email" placeholder="' . ENTRY_EMAIL_ADDRESS . '"', 'email'). ' '; echo tep_draw_button(MODULE_FOOTER_MAILCHIMP_SUBMIT, null, null, 'success','id="SendButton','xs') . tep_draw_hidden_field('anonymous', 'anonymous'); } echo $endform; ?> <div><span class="message" id="message"><span></div> </div> </div>
  3. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    You must to adjust the html page of the module to your website.
  4. It can do that. First it force the devise because it identfy the ip and your configuration. After if you display the currency box, the customer can change. Do not test exactly; I will try.
  5. Hi guy, There my code that I write, the pb this code is made for the next release 2.4 and not 2.3. I have no time to propose an update on the module than I make before. In this case, I can propose you the module for 2.4. It's very simple approach and you can update for the 2.3 easily. The approach is under hook but you can create another hook or class fir 2.3. It's your choice. To introduce the code, you need : Update the hook for 2.3 (call jus below) Update this function : getJsonCustomerData() about the cache Update the install db for 2.3 approach. change OSCOM::GetIpAddress() by the appropriate function osc 2.3 (tep_get_ip_address()) That's all I think. insertl the hook at the bottom of application_top.php (of course updated for 2.3) Registry::get('Hooks')->call('AllShop', 'CurrenciesGeolocalisation'); Hook system. class CurrenciesGeolocalisation { protected $spider_flag; public function __construct() { global $spider_flag; $this->UrlAPISSL = "https://ssl.geoplugin.net/json.gp?ip="; $this->SSLKey = CONFIGURATION_CURRENCIES_GEOLOCALISATION_SSLKEY; $this->UrlAPI = 'http://www.geoplugin.net/json.gp?ip='; $this->spiderFlag = $spider_flag; $this->ipCustomer = OSCOM::GetIpAddress(); } /* * indicate different informations on the customer * @[member=param] $localisation_array return an array on the localisation * @[member=access] public */ private function setUrlAPI() { if (!empty($this->SSLKey) && !is_null($this->SSLKey)) { $url = $this->UrlAPISSL . $this->ipCustomer . '&k=' . $this->SSLKey; } else { $url = $this->UrlAPI . $this->ipCustomer; } return $url; } //------------------------------------------------------ // Debug //------------------------------------------------------ /** * Display all git information inside a repository or sub directory * @[member=param] $result, repository to analyse * @[member=Return] $repo,values of array of all git information * @[member=access] public */ public function displayDataAPI() { $data = '<pre>' . print_r($this->setUrlAPI(), true) . '</pre>'; return $data; } /** * getJsonCustomerData * @[member=param] * @[member=Return] $result all data for customer identification and insert in cahce * @[member=access] private */ private function getJsonCustomerData() { $OSCOM_Cache = Registry::get('Cache'); $ip = str_replace('.', '_', $this->ipCustomer); if($OSCOM_Cache->read('geolocalisation-' . $ip, 60)) { $result = $OSCOM_Cache->getCache(); } else { $url = file_get_contents($this->setUrlAPI() ); //content of readme. $data = json_decode($url); $result = $OSCOM_Cache->write($data, 'geolocalisation-' . $ip); } return $result; } /** * getCustomerCountryCode * @[member=param] * @[member=Return] $country_code,code iso 2 of the country - FR * @[member=access] public */ public function getCustomerCountryCode() { $data = $this->getJsonCustomerData(); $country_code = $data->geoplugin_countryCode; return $country_code; } /** * getCustomerCountryName * @[member=param] * @[member=Return] $country_code, name of the country - FRANCE * @[member=access] public */ public function getCustomerCountryName() { $data = $this->getJsonCustomerData(); $country_code = $data->geoplugin_countryName; return $country_code; } /** * getCustomerRegionCode * @[member=param] * @[member=Return] $region_code, region of the country name - Jura * @[member=access] public */ public function getCustomerRegionCode() { $data = $this->getJsonCustomerData(); $region_code = $data->geoplugin_regionCode; return $region_code; } /** * getCustomerRegionName * @[member=param] * @[member=Return] $region, baem of region of the country name - Jura * @[member=access] public */ public function getCustomerRegionName() { $data = $this->getJsonCustomerData(); $region = $data->geoplugin_regionName; return $region; } /** * getCustomerContinent * @[member=param] * @[member=Return] $continent, conteninent of the country - NA / EU / AS ... * @[member=access] public */ public function getCustomerContinent() { $data = $this->getJsonCustomerData(); $continent = $data->geoplugin_continentCode; return $continent; } /* * Currency in function the localisation * @[member=param] $new_currency return the currency in function the localisation * @[member=access] public * osc_get_currencies_location */ public function GetCurrenciesLocation() { $country_code2 = $this->getCustomerCountryCode(); if ($this->getCustomerContinent() == 'NA') { if ($country_code2 == 'CA') { if (DEFAULT_CURRENCY != 'CAD') { $new_currency = 'CAD'; } else { $new_currency = DEFAULT_CURRENCY; } } elseif ($country_code2 == 'US') { if (DEFAULT_CURRENCY != 'USD') { $new_currency = 'USD'; } else { $new_currency = DEFAULT_CURRENCY; } } else { $new_currency = DEFAULT_CURRENCY; } } elseif ($this->getCustomerContinent() == 'EU') { if ($country_code2 == 'EU') { if (DEFAULT_CURRENCY != 'EUR') { $new_currency = 'EUR'; } else { $new_currency = DEFAULT_CURRENCY; } } else { $new_currency = DEFAULT_CURRENCY; } } else { $new_currency = DEFAULT_CURRENCY; } return $new_currency; } /* * Define currency in function the localisation * @[member=param] * @[member=Return] : false is nothing else return the currency * @[member=access] public * osc_get_currencies_location */ private function getCurrenciesByGeolocalization() { if (CONFIGURATION_CURRENCIES_GEOLOCALISATION == 'true') { $currencies_by_geolocalization = $this->GetCurrenciesLocation(); } else { $currencies_by_geolocalization = false; } return $currencies_by_geolocalization ; } /* * Install db if does'nt exist * @[member=param] * @[member=access] private * */ private function install() { $OSCOM_Db = Registry::get('Db'); $OSCOM_Language = Registry::get('Language'); if ($OSCOM_Language->getID() == 1) { $OSCOM_Db->save('configuration', [ 'configuration_title' => 'Souhaitez-vous afficher une devise automatique par défaut en fonction du continent ?', 'configuration_key' => 'CONFIGURATION_CURRENCIES_GEOLOCALISATION', 'configuration_value' => 'false', 'configuration_description' => 'En fonction de la provenance du client et de son continent, le tarif du produit prend par défaut la devise du continent du client.<br /><br /><u><strong>Note :</strong></u><br />- Les devises par défaut implémentées sont : USD, EUR, CAD <br />- Si le client provient d\'un autre continent, ce sera la devise par défaut qui s\'affichera.<br />- L\'ajustement automatique des devises en fonction de la langue ne fonctionne pas dans ce cas.<br />L\'analyse de l\'addresseIP du client est faite à partir de ce site : http://geoplugin.net.<br'>http://geoplugin.net.<br />Veuillez lire leurs instructions.<br /><br /><i>(Valeur True = Oui - Valeur False = Non)</i>', 'configuration_group_id' => '1', 'sort_order' => '9', 'set_function' => 'osc_cfg_set_boolean_value(array(\'true\', \'false\'))', 'date_added' => 'now()' ] ); $OSCOM_Db->save('configuration', [ 'configuration_title' => 'Souhaitez-vous indiquer la clef pour une certification SSL de géolocalisation en fonction de la devise automatique continent (non obligatoire) ?', 'configuration_key' => 'CONFIGURATION_CURRENCIES_GEOLOCALISATION_SSLKEY', 'configuration_value' => '', 'configuration_description' => 'Le site http://geoplugin.net peut vous fournir une clef qui vous permettra d\avoir une connexion sécurisée. Veuillez vous y référer pour plus d\'informations</i>', 'configuration_group_id' => '1', 'sort_order' => '9', 'set_function' => '', 'date_added' => 'now()' ] ); } else { $OSCOM_Db->save('configuration', [ 'configuration_title' => 'Do you want display an automatic default currency by continent ?', 'configuration_key' => 'CONFIGURATION_CURRENCIES_GEOLOCALISATION', 'configuration_value' => 'false', 'configuration_description' => 'Depending on the source of the client and the continent, the price is updated in function the customer continent.<br /><br /><u><strong>Note :</strong></u><br />- The default currency implemented are: USD, EUR, CAD <br />- If the customer comes from another continent, it will be the default currency that is displayed.<br />- The automatic adjustment of currencies depending the language does not work in this case.', 'configuration_group_id' => '1', 'sort_order' => '9', 'set_function' => 'osc_cfg_set_boolean_value(array(\'true\', \'false\'))', 'date_added' => 'now()' ] ); $OSCOM_Db->save('configuration', [ 'configuration_title' => 'Do you want insert a Key for SSL certification for your automatic currencies by continent (no mandatory) ?', 'configuration_key' => 'CONFIGURATION_CURRENCIES_GEOLOCALISATION_SSLKEY', 'configuration_value' => '', 'configuration_description' => 'The website http://geoplugin.net can propose you a SSL key for a secure connexion. Please go on website and see their documentation', 'configuration_group_id' => '1', 'sort_order' => '9', 'set_function' => '', 'date_added' => 'now()' ] ); } } public function execute() { if (!defined(CONFIGURATION_CURRENCIES_GEOLOCALISATION) == true || CONFIGURATION_CURRENCIES_GEOLOCALISATION == null || empty(CONFIGURATION_CURRENCIES_GEOLOCALISATION)) { $this->install(); } if ($this->spiderFlag === false) { if ($this->getCurrenciesByGeolocalization() != false) { $_SESSION['currency'] = $this->getCurrenciesByGeolocalization(); } return $_SESSION['currency']; } } }
  6. Gyakutsuki

    Automatic Currency adjustment by continent

    No it doesn' work because the site is down.
  7. A new contribution with a web service who adjust automaticly the currencies in function the country. If you default currency is CAD and your configuration has EUR, then the customer come from Europe see automaticly the EUR By default : All Europe : EUR North America : USD (United States) and CAD (Canada) Default : your default currency you can use the webservice until 100 000 resquest by day Let me know your experience. http://addons.oscommerce.com/info/8571
  8. Ok, if you don'tl tel me the files I don't search everytime. I think your problem become in my opinion on the transfert value, I have some problem with that and that's why you need to use $_SESSION['coupon']. Go back on the page I sent you above and try to follow the debug and test every time if you see all the values. checkout_payment discount class checkout confirmation order_total checkout process
  9. it appears with string(6) "erika2" at the top of the confirmation page... does that help? Seems the value is created. Try to test in order_total directory, discount_coupon.php if you see the calcul of the coupon by a var_dump($this->output); If you don't see the coupon line or not the calcul, it seems the $coupon does'nt pass, and it's better to use $_SESSION. It can be a pb with php version.
  10. it breaks it, normal, you need to see an information about $_SESSION['coupon']. If you see you coupon, it's ok, if not, pb. try to reinstall de contribution with a software like beyond compare. It's important to the value else in checkout confirmation you won't see the information.
  11. could you look in order class if you have $_SESSION['coupon'] if yes write this var_dump($_SESSION['coupon']) exit; and test
  12. your problem is the coupon value. It does'nt sent I think.
  13. look this : http://forums.oscommerce.com/topic/213019-contribution-discount-coupon-codes/page-171
  14. Look if the session is correct in confirmation echo $_SESSION['coupon']; exit; I you don't see the session,you have a pb. See the page above, I explain in details this pb.
  15. shoppingCart::attributes_price does'nt exist in 2.3.x and replace this elementpar the old. $_SESSION['cart']->attributes_price I think.
  16. The only pb with my contribution is some script can doesn't work and they need to be improve and you need to do becarefull on that.
  17. no like this <?php // Display cache (if any) getDisplayCache(); // if it is displayed, die function will end the program here. // if no cache, callback cache ob_start ('cache'); ?> It's for only test. Look also in ftp the if the cache is created or not
  18. @Gergely There a cache system for this. create a directory in Cache/Files inside icludes/work include theses elements in includes/functions/general at the end. function getUrl () { if (!isset($_SERVER['REQUEST_URI'])) { $url = $_SERVER['REQUEST_URI']; } else { $url = $_SERVER['SCRIPT_NAME']; $url .= (!empty($_SERVER['QUERY_STRING']))? '?' . $_SERVER[ 'QUERY_STRING' ] : ''; } return $url; } //getUrl gets the queried page with query string function cache ($buffer) { //page's content is $buffer $url = $this->getUrl(); $filename = md5($url) . '.cache'; $data = time() . '¦' . $buffer; $filew = fopen(DIR_FS_CATALOG . 'includes/work/Cache/Files/' . $filename, 'w'); fwrite($filew, $data); fclose($filew); return $buffer; } function getDisplayCache() { $url = $this->getUrl(); $filename = md5($url) . '.cache'; if (!file_exists(DIR_FS_CATALOG . 'includes/work/Cache/Files/' . $filename)) { return false; } $filer = fopen(DIR_FS_CATALOG . 'includes/work/Cache/Files/' . $filename, 'r'); $data = fread($filer, filesize(DIR_FS_CATALOG . 'includes/work/Cache/Files/' . $filename)); fclose($filer); $content = explode('¦', $data, 2); if (count($content)!= 2 OR !is_numeric($content['0'])) { return false; } if (time()-(100) > $content['0']) { // 100 is the cache time here!!! return false; } echo $content['1']; die(); } Now in template_bootom at the end include this // Display cache (if any) getDisplayCache(); // if it is displayed, die function will end the program here. // if no cache, callback cache ob_start ('cache');
  19. ok, change osc_cfg_select_option by tep_cfg_select_option
  20. @Compare the class with this: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2014 osCommerce Released under the GNU General Public License */ class oscTemplate { var $_title; var $_blocks = array(); var $_content = array(); var $_grid_container_width = 12; var $_grid_content_width = BOOTSTRAP_CONTENT; var $_grid_column_width = 0; // deprecated var $_data = array(); function __constrcut() { $this->_title = TITLE; } function setGridContainerWidth($width) { $this->_grid_container_width = $width; } function getGridContainerWidth() { return $this->_grid_container_width; } function setGridContentWidth($width) { $this->_grid_content_width = $width; } function getGridContentWidth() { return $this->_grid_content_width; } function setGridColumnWidth($width) { $this->_grid_column_width = $width; } function getGridColumnWidth() { return (12 - BOOTSTRAP_CONTENT) / 2; } function setTitle($title) { $this->_title = $title; } function getTitle() { return $this->_title; } function addBlock($block, $group) { $this->_blocks[$group][] = $block; } function hasBlocks($group) { return (isset($this->_blocks[$group]) && !empty($this->_blocks[$group])); } function getBlocks($group) { /* if ($this->hasBlocks($group)) { return implode("\n", $this->_blocks[$group]); } */ if ($this->hasBlocks($group)) { if (CONFIGURATION_MINIFY_TEMPLATE == 'false') { $getblock = implode("\n", $this->_blocks[$group]); } else { require_once(DIR_WS_CLASSES . '/MinifyCode.php'); $minifyCode = new MinifyCode(); $str = implode("\n", $this->_blocks[$group]); $getblock = $minifyCode->minifyHtml($str); } return $getblock; } } function buildBlocks() { global $language; if ( defined('TEMPLATE_BLOCK_GROUPS') && tep_not_null(TEMPLATE_BLOCK_GROUPS) ) { $tbgroups_array = explode(';', TEMPLATE_BLOCK_GROUPS); foreach ($tbgroups_array as $group) { $module_key = 'MODULE_' . strtoupper($group) . '_INSTALLED'; if ( defined($module_key) && tep_not_null(constant($module_key)) ) { $modules_array = explode(';', constant($module_key)); foreach ( $modules_array as $module ) { $class = basename($module, '.php'); if ( !class_exists($class) ) { if ( file_exists(DIR_WS_LANGUAGES . $language . '/modules/' . $group . '/' . $module) ) { include(DIR_WS_LANGUAGES . $language . '/modules/' . $group . '/' . $module); } if ( file_exists(DIR_WS_MODULES . $group . '/' . $module) ) { include(DIR_WS_MODULES . $group . '/' . $module); } } if ( class_exists($class) ) { $mb = new $class(); if ( $mb->isEnabled() ) { $mb->execute(); } } } } } } } function addContent($content, $group) { $this->_content[$group][] = $content; } function hasContent($group) { return (isset($this->_content[$group]) && !empty($this->_content[$group])); } function getContent($group) { global $language; if ( !class_exists('tp_' . $group) && file_exists(DIR_WS_MODULES . 'pages/tp_' . $group . '.php') ) { include(DIR_WS_MODULES . 'pages/tp_' . $group . '.php'); } if ( class_exists('tp_' . $group) ) { $template_page_class = 'tp_' . $group; $template_page = new $template_page_class(); $template_page->prepare(); } foreach ( $this->getContentModules($group) as $module ) { if ( !class_exists($module) ) { if ( file_exists(DIR_WS_MODULES . 'content/' . $group . '/' . $module . '.php') ) { if ( file_exists(DIR_WS_LANGUAGES . $language . '/modules/content/' . $group . '/' . $module . '.php') ) { include(DIR_WS_LANGUAGES . $language . '/modules/content/' . $group . '/' . $module . '.php'); } include(DIR_WS_MODULES . 'content/' . $group . '/' . $module . '.php'); } } if ( class_exists($module) ) { $mb = new $module(); if ( $mb->isEnabled() ) { $mb->execute(); } } } if ( class_exists('tp_' . $group) ) { $template_page->build(); } if ($this->hasContent($group)) { if (CONFIGURATION_MINIFY_TEMPLATE == 'false') { $contentblock = implode("\n", $this->_content[$group]); } else { require_once(DIR_WS_CLASSES . '/MinifyCode.php'); $minifyCode = new MinifyCode(); $str = implode("\n", $this->_content[$group]); $contentblock = $minifyCode->minifyHtml($str); } return $contentblock; } } function getContentModules($group) { $result = array(); foreach ( explode(';', MODULE_CONTENT_INSTALLED) as $m ) { $module = explode('/', $m, 2); if ( $module[0] == $group ) { $result[] = $module[1]; } } return $result; } } look : My configuration / mystore . You must see this element : Do you want to minify the html code in the shop catalog If not insert the request below. INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Do you want to minify the html code in the shop catalog', 'CONFIGURATION_MINIFY_TEMPLATE', 'false', 'Minify the HTML code to improve site speed' , '1', '5', 'osc_cfg_select_option(array(\'true\', \'false\'), ', now()); Don't forget to include the class files inside class directory. After you can test and activate the option or not.
  21. @grandpaj . The config is in general administrationwher you found the store name.
  22. @grandpaj this code does'nt exist now; It was before, just apply the contribution in download, that's all. $oscTemplate->getContent('account') by by $oscTemplate->getMinifyTemplateBlockContent('account') $oscTemplate->getBlocks('account') by $oscTemplate->getMinifyTemplateBlockModule('account')
  23. Tk for correction. Like I said, Google propose in their criteria to minify html, css, js. After that the speed is for me a relative indicator and depends the contribution what do you have. For me the speed is increased.
  24. @burt done : http://addons.oscommerce.com/info/9480
  25. @burt Ok I will make it after the soccer :)
×