Jump to content

Gyakutsuki

♥Ambassador
  • Content count

    727
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by Gyakutsuki

  1. Gyakutsuki

    Automatic Currency adjustment by continent

    No it doesn' work because the site is down.
  2. 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
  3. 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
  4. 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.
  5. 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.
  6. could you look in order class if you have $_SESSION['coupon'] if yes write this var_dump($_SESSION['coupon']) exit; and test
  7. your problem is the coupon value. It does'nt sent I think.
  8. look this : http://forums.oscommerce.com/topic/213019-contribution-discount-coupon-codes/page-171
  9. @GLWalker There 2 examples : One to execute a function, one to display something Also if a hook exist you can extend with another hook. Advantage no intervention in the code and in orignal hook but for not the best solution (depends of the situation) Hook with call (not display) $OSCOM_Hooks->call('Orders', 'ActionDeleteConfirm'); <?php namespace OSC\OM\Module\Hooks\Admin\Orders; use OSC\OM\OSCOM; use OSC\Sites\Admin\OrderAdmin; class ActionDeleteConfirm { public function __construct() { if (OSCOM::getSite() != 'Admin') { OSCOM::redirect('index.php'); } $this->restock = $_POST['restock']; $this->oID = (int)$_GET['oID']; } private function redirect() { OSCOM::redirect('admin/orders.php', osc_get_all_get_params(array('oID', 'action')), 'AUTO'); } public function execute() { OrderAdmin::removeOrder($this->oID, $this->restock); $this->redirect(); } } Hook with with display (very simple) Registry::get('Hooks')->call('AllShop', 'FirstTime'); <?php namespace OSC\OM\Module\Hooks\Shop\AllShop; class FirstTime { public function execute() { echo TEXT_INSTALL; echo ' <div class="text-md-center;"><br /><a href="http://www.mysite.org/" target="_blank"><img src="images/logo.png" border="0" height="100" width="100" alt="Site"><br />Go to Site</a></div>'; echo ' <div class="text-md-center" style="font-size: 10px;padding-top:10px;">blabla <a href="http://www.mysite.com" target="_blank">mysite</a>.</div>'; } }
  10. 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.
  11. shoppingCart::attributes_price does'nt exist in 2.3.x and replace this elementpar the old. $_SESSION['cart']->attributes_price I think.
  12. 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.
  13. 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
  14. @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');
  15. ok, change osc_cfg_select_option by tep_cfg_select_option
  16. @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.
  17. @grandpaj . The config is in general administrationwher you found the store name.
  18. @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')
  19. 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.
  20. @burt done : http://addons.oscommerce.com/info/9480
  21. @burt Ok I will make it after the soccer :)
  22. burt The both normal or BS are the same,I think you talk about the code. One classe (see below) Just a little modification inside the template. It's not intrusive. For example, the addblock is change like this public function getBlocks($group) { if ($this->hasBlocks($group)) { if (CONFIGURATION_MINIFY_TEMPLATE == 'false') { $getblock = implode("\n", $this->_blocks[$group]); } else { require ('includes/classes/MinifyCode'); $minifyCode = new MinifyCode(); $str = implode("\n", $this->_blocks[$group]); $getblock = $minifyCode->minifyHtml($str); } return $getblock; } } You must just recopy the code for addcontent. No other modifications. After concerning the cache it's an another problem, don't include for the moment. the best way is to test.
  23. @burt The speed depends on your addon on you website, for example you insert a banner rotative in responsive, there is an influence on the speed, you don't minify the js, there is an influence. Depends on the server configuration, there also is an influence. I think the speed is not the best indicator to compare with your sytem but the code must respect the criterias by google. Concerning this code, I use only for html code but the code is also make for css and js. And it must developped with a cache system appropriate or with the cache developped inside Osc. That's I noted, my page is downloaded more fastest than before without cache. Note :You must adapte to content page the code.
  24. @GergelyYes it's better, you can optimise the code with only one modiification inside template and osc code. delete this line function getMinifyTemplateBlockContent($template_module) { if (CONFIGURATION_MINIFY_TEMPLATE == 'true') { // activate or not the minifycode $minifyCode = new MinifyCode(); $str = $this->getBlocks($template_module); $minify = $minifyCode->minifyHtml($str); // minify the only the html code } else { $minify = $this->getBlocks($template_module); } return $minify; } update this line public function getBlocks($group) { if ($this->hasBlocks($group)) { if (CONFIGURATION_MINIFY_TEMPLATE == 'false') { $getblock = implode("\n", $this->_blocks[$group]); } else { require ('includes/classes/MinifyCode'); $minifyCode = new MinifyCode(); $str = implode("\n", $this->_blocks[$group]); $getblock = $minifyCode->minifyHtml($str); } return $getblock; } } That's all.
×