Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

movieseals

Backer
  • Content Count

    346
  • Joined

  • Last visited

  • Days Won

    2

movieseals last won the day on December 18 2019

movieseals had the most liked content!

Community Reputation

42 Excellent

About movieseals

  • Rank
    Christian Viel

Recent Profile Visitors

1,033 profile views
  1. I have the same error if people are not logged in: THE PRODUCT SELECTION CANNOT BE DELIVERED BY THE AVAILABLE CARRIER(S): IT IS TOO HEAVY. PLEASE AMEND YOUR CART TO LOWER ITS WEIGHT. If you are logged in BEFORE adding anything to cart, the error does not appear. And everything goes smooth. If you login AFTER adding anything to cart with an existing account, the error is there. However, payment goes through and the order is generated. If you are a guest or visitor, the error appears and it keeps appearing and screwing up payment even after they create an account. The payment goes through but the order is not created. Any help?
  2. OK. It appears that the issue is related to guest or visitors logins - if a user is logged in with his account as a customer, there is no error message. However, if he first add items to his cart as a guest or visitor, until he actually logs in, the following error message appears: THE PRODUCT SELECTION CANNOT BE DELIVERED BY THE AVAILABLE CARRIER(S): IT IS TOO HEAVY. PLEASE AMEND YOUR CART TO LOWER ITS WEIGHT. No matter what shipping I set up, including pickup in store which has a limit of 1000 kg, this message appears... It prevents orders from being completed and it freaks customers out. Help!
  3. I started having the same issues lately but I do not have Advanced stock management set. It used to work fine but intermittently, it will claim that the order is too heavy for the carriers, whereas it is not. I cannot find what is causing this, as no settings where changed for the carriers in a long time.
  4. You need to create the province in Localizations>States It normally works flawlessly - I dunno why things went all wonky this week. Some was due to PHP 7.3, which might be an issue, some of it I cannot pinpoint yet.
  5. You do not need a module for that - you can do it with the actual system and it works - at least it still does for me for that specific carrier type. And while we are on the subject, it would be cool if the language could be applied to the Carrier Name, because the laws here require that on the French site everything should be in French and the fact that only one name in one language is allowed makes things difficult... Here is my setup, if it can help you... Do not use the free shipping, just set the amount to zero. The free shipping thing is buggy and it yields weird results. It will appear free to customers anyways.
  6. I just started having the same problem under TB 1.1.x. It used to work fine and it was not changed. But I get this error all the time now. It is intermittent but more often than not, the error appears.
  7. Hi again! A new issue has popped up. Customers get the following message sometimes when attempting to check out: THERE IS 1 ERROR THE PRODUCT SELECTION CANNOT BE DELIVERED BY THE AVAILABLE CARRIER(S): IT IS TOO HEAVY. PLEASE AMEND YOUR CART TO LOWER ITS WEIGHT. I have searched the forum and some other users mentioned that issue but their fix do not seem to work for me at the moment. The weight is way below the limits in all cases and the settings are the same they have always been (and working without issue before). Even worst, the issue is intermittent - sometimes it happens, sometimes it doesn't and I have not been able to figure out the pattern. Anybody else has encountered this and managed to fix this issue? Losing lots of sales because most people just abandon their cart instead of contacting us.
  8. Will do. I had gone to the website and downloaded the latest update, but it still has that issue.
  9. I misunderstood you. Rookie mistake. 😞 It works now. Thank you so much for your assistance!
  10. If I change line 51 with $this->module->execPayment($cart); now the entire site gives a 500 error.
  11. Here is the whole code. I put line 50 in red, and everything from 247: <?php /** * This file is part of module Interac Email Money Transfer * * @author Bellini Services <bellini@bellini-services.com> * @copyright 2007-2017 bellini-services.com * @license readme * * Your purchase grants you usage rights subject to the terms outlined by this license. * * You CAN use this module with a single, non-multi store configuration, production installation and unlimited test installations of PrestaShop. * You CAN make any modifications necessary to the module to make it fit your needs. However, the modified module will still remain subject to this license. * * You CANNOT redistribute the module as part of a content management system (CMS) or similar system. * You CANNOT resell or redistribute the module, modified, unmodified, standalone or combined with another product in any way without prior written (email) consent from bellini-services.com. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (!defined('_PS_VERSION_')) exit; class iemt extends PaymentModule { private $_html = ''; private $_postErrors = array(); public function __construct() { $this->name = 'iemt'; $this->tab = 'payments_gateways'; $this->version = '2.0.0'; $this->ps_versions_compliancy = array('min' => '1.6', 'max' < '1.7'); $this->author = 'Bellini Services'; $this->controllers = array('validation'); $this->is_eu_compatible = 0; $this->currencies = true; $this->currencies_mode = 'checkbox'; $this->need_instance = 1; $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('Interac Email Money Transfer'); $this->description = $this->l('Accepts payments by Interac Email Money Transfer'); $this->confirmUninstall = $this->l('Are you sure you want to delete your details ?'); } public function install() { if (!parent::install() OR !$this->registerHook('adminOrder') OR !$this->registerHook('header') OR !$this->registerHook('payment') OR !$this->registerHook('paymentReturn')) return false; /* Set database */ if (!Db::getInstance()->Execute('CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'interac_order` ( `id_order` int(10) unsigned NOT NULL, `challenge_answer` varchar(255) NOT NULL, PRIMARY KEY (`id_order`) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8')) return false; copy(dirname(__FILE__).'/mails/en/iemt.html', dirname(__FILE__).'/../../mails/en/iemt.html'); copy(dirname(__FILE__).'/mails/en/iemt.txt', dirname(__FILE__).'/../../mails/en/iemt.txt'); if (!Configuration::get('INTERAC_OS_PENDING_PAYMENT')) { $orderState = new OrderState(); $orderState->send_email = true; $orderState->name = array(); $orderState->template = array(); foreach (Language::getLanguages() AS $language) { $orderState->name[$language['id_lang']] = 'Waiting for Interac Email Payment'; $orderState->template[$language['id_lang']] = 'iemt'; } $orderState->color = 'lightblue'; $orderState->hidden = false; $orderState->delivery = false; $orderState->logable = false; $orderState->invoice = false; if ($orderState->add()) copy(dirname(__FILE__).'/../../img/os/'.Configuration::get('PS_OS_CHEQUE').'.gif', dirname(__FILE__).'/../../img/os/'.(int)$orderState->id.'.gif'); Configuration::updateValue('INTERAC_OS_PENDING_PAYMENT', (int)$orderState->id); } Configuration::updateValue('INTERAC_PAYMENT_EMAIL', Configuration::get('PS_SHOP_EMAIL')); return true; } public function uninstall() { if (!parent::uninstall()) return false; return true; } public function getContent() { if (Tools::isSubmit('SubmitIEMT')) { $this->_postValidation(); if (!count($this->_postErrors)) $this->_postProcess(); else foreach ($this->_postErrors as $err) $this->_html .= $this->displayError($err); } else $this->_html .= '<br />'; $this->_html .= $this->_displayIemt(); $this->_html .= $this->renderForm(); return $this->_html; } protected function _postValidation() { if (Tools::isSubmit('SubmitIEMT')) { if (!Tools::getValue('INTERAC_PAYMENT_EMAIL')) $this->_postErrors[] = $this->l('The Payment Email is required.'); } } protected function _postProcess() { if (Tools::isSubmit('SubmitIEMT')) Configuration::updateValue('INTERAC_PAYMENT_EMAIL', pSQL(Tools::getValue('INTERAC_PAYMENT_EMAIL'))); $this->_html .= $this->displayConfirmation($this->l('Settings updated')); } protected function _displayIemt() { return $this->display(__FILE__, 'views/templates/hook/infos.tpl'); } public function renderForm() { $fields_form = array( 'form' => array( 'legend' => array( 'title' => $this->l('Contact details'), 'icon' => 'icon-envelope' ), 'input' => array( array( 'type' => 'text', 'label' => $this->l('Payment Email'), 'name' => 'INTERAC_PAYMENT_EMAIL', 'size' => 100, 'required' => true ), ), 'submit' => array( 'title' => $this->l('Save'), ) ), ); $helper = new HelperForm(); $helper->show_toolbar = false; $helper->table = $this->table; $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT')); $helper->default_form_language = $lang->id; $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; $this->fields_form = array(); $helper->id = (int)Tools::getValue('id_carrier'); $helper->identifier = $this->identifier; $helper->submit_action = 'SubmitIEMT'; $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->tpl_vars = array( 'fields_value' => $this->getConfigFieldsValues(), 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id ); return $helper->generateForm(array($fields_form)); } public function getConfigFieldsValues() { return array( 'INTERAC_PAYMENT_EMAIL' => Tools::getValue('INTERAC_PAYMENT_EMAIL', Configuration::get('INTERAC_PAYMENT_EMAIL')), ); } private function isCheckout() { //return true if the controller is in the array $controllers = array('order', 'order-opc', 'orderopc', 'quick-order'); $controller = Tools::getValue('controller'); if (in_array($controller, $controllers)) return true; else return false; } public function hookHeader() { if (!$this->active) return; $isCheckout = $this->isCheckout(); if (!$isCheckout) return; $this->context->controller->addJquery(); $this->context->controller->addJQueryPlugin('fancybox'); } public function hookPayment($params) { if (!$this->active) return; $validation_url = $this->context->link->getModuleLink($this->name, 'validation', array(), true); $this->context->smarty->assign(array( 'iemt_validation_url' => $validation_url, 'mess_error' => $this->l('Please provide a challenge answer'), 'this_path_iemt' => $this->getPathUri(), )); return $this->display(__FILE__, 'views/templates/front/payment.tpl'); } public function execPayment($cart_old) { if (!$this->active) return; $customer = $this->context->customer; $currency = $this->context->currency; $cart = $this->context->cart; $total = (float)$cart->getOrderTotal(true, Cart::BOTH); //todo: validate $challengeAnswer, redirect to payment page with error $challengeAnswer = pSQL(Tools::getValue('challenge')); //todo: validate $challengeAnswer, redirect to payment page with error $mailVars = array( '{shop_phone}' => Configuration::get('PS_SHOP_PHONE'), '{payment_email}' => Configuration::get('INTERAC_PAYMENT_EMAIL'), '{challenge_answer}' => $challengeAnswer, '{history_url}' => $this->context->link->getPageLink('history', true, $this->context->language->id, null, false, $this->context->shop->id), '{my_account_url}' => $this->context->link->getPageLink('my-account', true, $this->context->language->id, null, false, $this->context->shop->id), '{guest_tracking_url}' => $this->context->link->getPageLink('guest-tracking', true, $this->context->language->id, null, false, $this->context->shop->id), ); $this->validateOrder((int)$cart->id, Configuration::get('INTERAC_OS_PENDING_PAYMENT'), $total, $this->displayName, null, $mailVars, (int)$currency->id, false, $customer->secure_key, $this->context->shop); $order = new Order($this->currentOrder); if (Validate::isLoadedObject($order)) { Db::getInstance()->Execute(' INSERT INTO `'._DB_PREFIX_.'interac_order` (`id_order`, `challenge_answer`) VALUES ('.(int)$order->id.', \''.pSQL($challengeAnswer).'\')'); } // Redirect the user to the order confirmation page / history $redirect = $this->context->link->getPageLink('order-confirmation', true, null, array('id_order' => (int)$this->currentOrder, 'id_cart' => (int)$cart->id, 'key' => $customer->secure_key, 'id_module' => $this->id)); Tools::redirect($redirect); } public function hookPaymentReturn($params) { if (!$this->active) return; if ($params['objOrder']->module != $this->name) return; $id_order = $params['objOrder']->id; $this->context->smarty->assign(array( 'iemt_total_paid' => $params['objOrder']->total_paid, 'iemt_id_currency' => $params['objOrder']->id_currency, 'total' => $params['currency'].$params['total_to_pay'], 'challengeAnswer' => $this->_getChallengeAnswer((int)($id_order)), 'paymentEmail' => Configuration::get('INTERAC_PAYMENT_EMAIL'), 'shopPhone' => Configuration::get('PS_SHOP_PHONE'), )); $this->context->smarty->assign('order_name', $params['objOrder']->getUniqReference()); return $this->display(__FILE__, 'views/templates/front/confirmation.tpl'); } public function hookAdminOrder($params) { $order = new Order((int) ($params['id_order'])); $challengeAnswer = $this->_getChallengeAnswer((int)($order->id)); if (!$challengeAnswer) { return false; } $html = '<div class="col-lg-7"><div class="panel"><h3><i class="icon-money"></i> '.$this->l('Interac Challenge Answer').'</h3><div class="row">'. '<div style="float:left;">' . $this->l('Challenge Answer') . ' : ' . Tools::htmlentitiesUTF8($challengeAnswer) . '</div>'. '</div></div></div>'; return $html; } private function _getChallengeAnswer($id_order) { if (!(int)$id_order) return false; return Db::getInstance()->getValue(' SELECT `challenge_answer` FROM `'._DB_PREFIX_.'interac_order` WHERE `id_order` = '.(int)$id_order); } }
  12. Using Bellini's Interac module, which used to work fine, with the TB compatible version and TB 1.1.x - latest version. I did check the configuration table in the DB for INTERAC_OS_PENDING_PAYMENT and it had indeed the wrong order status, which I fixed, but unlike my other module, the customer still gets a 500 error and I get this in the logs: Decoded exception Too few arguments to function iemt::execPayment(), 0 passed in /home/zbookstore/public_html/modules/iemt/controllers/front/validation.php on line 51 and exactly 1 expected in file modules/iemt/iemt.php at line 237 Source file: modules/iemt/iemt.php 218: $this->context->controller->addJquery(); 219: $this->context->controller->addJQueryPlugin('fancybox'); 220: } 221: 222: public function hookPayment($params) 223: { 224: if (!$this->active) 225: return; 226: 227: $validation_url = $this->context->link->getModuleLink($this->name, 'validation', array(), true); 228: $this->context->smarty->assign(array( 229: 'iemt_validation_url' => $validation_url, 230: 'mess_error' => $this->l('Please provide a challenge answer'), 231: 'this_path_iemt' => $this->getPathUri(), 232: )); 233: 234: return $this->display(__FILE__, 'views/templates/front/payment.tpl'); 235: } 236: 237: public function execPayment($cart_old) 238: { 239: if (!$this->active) 240: return; 241: 242: $customer = $this->context->customer; 243: $currency = $this->context->currency; 244: $cart = $this->context->cart; 245: $total = (float)$cart->getOrderTotal(true, Cart::BOTH); 246: 247: //todo: validate $challengeAnswer, redirect to payment page with error Stack trace 1. modules/iemt/controllers/front/validation.php:51 source iemt->execPayment() 32: { 33: $cart = $this->context->cart; 34: if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) 35: Tools::redirect('index.php?controller=order&step=1'); 36: 37: // Check that this payment option is still available in case the customer changed his address just before the end of the checkout process 38: $authorized = false; 39: foreach (Module::getPaymentModules() as $module) 40: { 41: if ($module['name'] == 'iemt') 42: { 43: $authorized = true; 44: break; 45: } 46: } 47: 48: if (!$authorized) 49: die($this->module->l('This payment method is not available.', 'validation')); 50: 51: $this->module->execPayment(); 52: } 53:} 2. classes/controller/Controller.php:197 source IemtValidationModuleFrontController->postProcess() 178: } else { 179: $this->$property = $value; 180: } 181: } 182: 183: /** 184: * Starts the controller process 185: * 186: * @since 1.0.0 187: * @version 1.0.0 Initial version 188: */ 189: public function run() 190: { 191: $this->init(); 192: if ($this->checkAccess()) { 193: if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) { 194: $this->setMedia(); 195: } 196: 197: $this->postProcess(); 198: 199: if (!empty($this->redirect_after)) { 200: $this->redirect(); 201: } 202: 203: if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) { 204: $this->initHeader(); 205: } 206: 207: if ($this->viewAccess()) { 3. classes/controller/FrontController.php:255 source ControllerCore->run() 236: * @see Controller::run() 237: * @since 1.0.0 238: * 239: * @version 1.0.0 Initial version 240: */ 241: public function postProcess() 242: { 243: } 244: 245: /** 246: * Starts the controller process 247: * 248: * Overrides Controller::run() to allow full page cache 249: * 250: * @since 1.0.7 251: */ 252: public function run() 253: { 254: if (! PageCache::isEnabled()) { 255: return parent::run(); 256: } 257: 258: $debug = Configuration::get('TB_PAGE_CACHE_DEBUG'); 259: $cacheEntry = PageCache::get(); 260: if (! $cacheEntry->exists()) { 261: if ($debug) { 262: header('X-thirtybees-PageCache: MISS'); 263: } 264: return parent::run(); 265: } 4. classes/Dispatcher.php:852 source FrontControllerCore->run() 833: return; 834: } 835: break; 836: 837: default: 838: throw new PrestaShopException('Bad front controller chosen'); 839: } 840: 841: // Instantiate controller 842: try { 843: // Loading controller 844: $controller = Controller::getController($controllerClass); 845: 846: // Execute hook dispatcher 847: if (isset($paramsHookActionDispatcher)) { 848: Hook::exec('actionDispatcher', $paramsHookActionDispatcher); 849: } 850: 851: // Running controller 852: $controller->run(); 853: } catch (PrestaShopException $e) { 854: $e->displayMessage(); 855: } 856: } 857: 858: /** 859: * Retrieve the controller from url or request uri if routes are activated 860: * 861: * @param int|null $idShop 862: * 5. ./index.php:33 source DispatcherCore->dispatch() 14: * If you did not receive a copy of the license and are unable to 15: * obtain it through the world-wide-web, please send an email 16: * to license@thirtybees.com so we can send you a copy immediately. 17: * 18: * DISCLAIMER 19: * 20: * Do not edit or add to this file if you wish to upgrade PrestaShop to newer 21: * versions in the future. If you wish to customize PrestaShop for your 22: * needs please refer to https://www.thirtybees.com for more information. 23: * 24: * @author thirty bees <contact@thirtybees.com> 25: * @author PrestaShop SA <contact@prestashop.com> 26: * @copyright 2017-2018 thirty bees 27: * @copyright 2007-2016 PrestaShop SA 28: * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 29: * PrestaShop is an internationally registered trademark & property of PrestaShop SA 30: */ 31: 32:require(dirname(__FILE__).'/config/config.inc.php'); 33:Dispatcher::getInstance()->dispatch();
  13. @datakick Thank you so much. I guess the PAYBYPHONE_OS_CALL got changed when we used an old backup - the order status was indeed wrong for some reason and even resetting the module had not fixed it, so changing it straight in the DB fixed it! Many thanks!
  14. Perfect. Gives me a clearer *for me and my level of knowledge* clue to investigate! Thanks so much!
  15. First, thank you so much for answering. So I need to change the order status ID? It used to work fine so I am not sure what changed there. This is line 46 $this->module->validateOrder($cart->id, Configuration::get('PAYBYPHONE_OS_CALL'), $total, $this->module->displayName, null, $mailVars, (int)$currency->id, false, $customer->secure_key);
×
×
  • Create New...