Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by PhpMadman

  1. If i remember correctly it is because your fields_list asks for quantity, and as you said, it matches both fields You can either change it to a.quantity or sa.quantity Or you can edit your select _select to 'sa.quantity AS qty' and change fields_list from quantity to qty. Assuming you want the quantity from stock_available
  2. Hello. I been away from PrestaShop coding for almost 2 years. So forgotten a lot. What is the best way to create a help page within the module? I added a lot of new feature, and next to module settings I want to show a help page explaining how the features work. I'm still using HelperForm for settings since it is 1.5 - 1.7 compatible. If it can't be done without building a controller page in admin, can I create a link to a notes.txt/html placed in the modules root then?
  3. A bit... just a bit late. But it's done. Sorry, no. The idea behind this module it to approve them manually after you have done whatever check-up you do on your customers. Do you still need help, and did you try the latest version 1.6.1 of the module?
  4. The latest version 1.6.1 should work on all PrestaShop 1.6 and later.
  5. Is the module setup correctly? Like this?
  6. Okey... This is really strange. It really should say Eutron. This is the last one I can give you. If this don't help, I have no idea how to fix this. This one has the name Eutron hardcored in to it. I tried it to in my shop, it says Eutron in the mail, even tho my shop is called Awesome. Also, I upgraded the version number to so make sure you get that version number on Modules page. validatecustomer.zip
  7. Yes. But have you configured the module to send YOU a message then a customer is registered, and have you activated the modules setting to automatically send e-mail when a customer is registered? Do you get that e-mail informing you that a customer has registered?
  8. Then I think you need to clear shop cache, or re-check your settings. I removed the shop name param from the module. Now the name is added by prestashop core code, and it get's the name from the PS_SHOP_NAME. That setting is set under Configure > Shop Parameters > Contact > Stores > Contact Details > Shop Name
  9. Okey. Lets try this one then. validatecustomer.zip
  10. Try this version. I changed the code for the e-mail. It now just makes one call for shop name. So if Chef Global is some how coming from PrestaShop or the Module, it will either say Eutron or Chef Global on all places of the mail. If it stays the same, it is most likely an mail client thing. And also, if needed, I could register an account on your site, to see how the mail looks to me. validatecustomer.zip
  11. I did some testing on and module 1.6.1, and I can't replicate your problem. Do you have this Chef Global anywhere in your PrestaShop, i.e a second store, employee name or anything like that? I checked the code, and it should display the shop name. I can't see any reason for this odd text to appear. Hi. Does the other mail works, is both options enabled? Do you get a mail when customer has registered?
  12. Okey. I'll do some test, see if I can find something. What version of PrestaShop and module are you running?
  13. Hi. I think that might be something in your e-mail client. This is how it looks to me in my client.
  14. I just updated some texts, so you need to re-translate those, other then that, it should be the same. Do you have some problem with the translations?
  15. I have made some updated on this again. And a thanks to @pujionodk for writing an better code then I thought of for needactivation template. Version 1.6.0 * Add option to select customergroups that need validation (Default Customer group is auto selected) * Removed debug code * Fixed bug in PS 1.6 support for validation message * Fixed spellings mistakes * Improved text displayed to customer * More updates to PSR-2 * Don't show need activation message if customer is logged in Version 1.6.1 * Added SQL security code * Happy 2019 I have tested this on, and it works fine. Version 1.6.0 was tested on a PrestaShop 1.6, but version 1.6.1 was not, so not sure they are fully compatible. validatecustomer.zip
  16. Hi. Feel free to post it. I think the texts are a good. The latest version I'm working on does have some changes in text, but mostly spellings mistakes.
  17. Hi. This is the new version, this works on my PrestaShop I haven't tested, but I think it should work on 1.6 as well. It most likely will not right now. I have plans to add something along the lines as darkdev did. A feature that allows you to select what profile that should be validated. Changelog: Version 1.5 Beta * Added code to ignore guestaccounts from order process -- A few years gap due to Madman got lost in a cave, or other wisebusy -- Version 1.5.0 * Updated for PS 1.7 * Fixed 500 Error on redirect * Fixed sending of mail * Updated template to PS 1.7 standard validatecustomer.zip
  18. Hi. It seems this module now has multiple issues. I'm working on fixing all problem for PrestaShop 1.7. What PrestaShop version are you running?
  19. By default is uses the bankwire status and e-mail. Have you made a new order status for swish payments? Did you connect the supplied mail templates to that status? If you are missing the mail templates, check the modules folder. There is one for English. Copy that to PS mail folder and if needed, translate it and move to correct folder. Did you change the module configuration to use the new status?
  20. Uhmm. Thank you. I guess? Any special reason for activating this 4 year old thread?
  21. I re-attached the file. Try the link in the post now
  22. Hi. The problem is that you don't set an array on name, description and link_rewrite. I have added an foreach loop on the products, so it adds the product and sets the same texts on all languages. I also think I have fixed the undefined indexes. You can find my changes by searching for //PhpMadman in the script. Hopefully it will get you what you want, or in the right direction. I'm note sure I have the time to help any more today. <?if(!defined("TDM_PROLOG_INCLUDED") || TDM_PROLOG_INCLUDED!==true)die(); //define('_PS_MODE_DEV_', true); $tm=time(); require($_SERVER["DOCUMENT_ROOT"].'/config/config.inc.php'); //$sql = 'SELECT * FROM `ps_1product` WHERE `id_product` = 10 '; //$arRes = Db::getInstance()->executeS($sql); //echo '<br><pre>';print_r($arRes);echo '</pre>'; global $TDMCore; if(!$context){$context = Context::getContext();} $PS_LANG = (string)$context->language->iso_code; //Groups: //$arPsUGroups = $context->customer->getGroups(); //array of linked groups $PsDefGroup = $context->customer->id_default_group; if(!TDM_ISADMIN){ $arPGID = $TDMCore->arPriceGID; foreach($arPGID as $TDM_GID=>$CMS_GID){ if($PsDefGroup==$CMS_GID){ if($_SESSION['TDM_USER_GROUP']!=$TDM_GID){$_SESSION['TDM_USER_GROUP']=$TDM_GID; Header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);} break; } } } //Lang // PhpMadman // Should fix undefined index error if(!isset($_GET['ulng']) || $_GET['ulng'] == '') { // if($_GET['ulng']==''){ if($PS_LANG AND TDM_LANG!=$PS_LANG AND in_array($PS_LANG,$TDMCore->arLangs)){ $_SESSION['TDM_LANG']=$PS_LANG; TDMRedirect($_SERVER['REQUEST_URI']); } } if(!TDM_ISADMIN){ $arPGID = $TDMCore->arPriceGID; global $USER; $arGroups = array((int)Group::getCurrent()->id); $isAuthorisedGroup = false; foreach($arPGID as $TDM_GID=>$CMS_GID){ if(in_array($CMS_GID,$arGroups)){ $isAuthorisedGroup = true; if($_SESSION['TDM_USER_GROUP']!=$TDM_GID){ $_SESSION['TDM_USER_GROUP']=$TDM_GID; header('Location: '.$_SERVER['REQUEST_URI']); } break; } } if (!$isAuthorisedGroup) { unset($_SESSION['TDM_USER_GROUP']); } } //Add to cart if(defined('TDM_ADD_TO_CART') AND TDM_ADD_TO_CART){ global $arCartPrice; if(is_array($arCartPrice)){ if($_REQUEST['QTY']>1){$QUANTITY=intval($_REQUEST['QTY']);}else{$QUANTITY=1;} // PhpMadman // Should fix undefined index if (isset($arCartPrice['OPTIONS']['MINIMUM'])) { if ($arCartPrice['OPTIONS']['MINIMUM'] > 1 AND $QUANTITY < $arCartPrice['OPTIONS']['MINIMUM']) { $QUANTITY=$arCartPrice['OPTIONS']['MINIMUM']; } } if($arCartPrice['OPTIONS']['MINIMUM']>1 AND $QUANTITY<$arCartPrice['OPTIONS']['MINIMUM']){$QUANTITY=$arCartPrice['OPTIONS']['MINIMUM'];} if($QUANTITY>$arCartPrice['AVAILABLE_NUM']){$QUANTITY=$arCartPrice['AVAILABLE_NUM'];} $DefaultCategory = intval($TDMCore->arSettings["CMS_DEFCATID"]); $Price = TDMConvertPrice($arCartPrice['CURRENCY'],$TDMCore->arSettings["CMS_ADDCART_CURRENCY"],$arCartPrice['PRICE']); $DefaultTaxGroup = 1; $VAT = 1.22; $PriceVAT = round($Price/$VAT,2); $Reference = $arCartPrice['ARTICLE'].' / '.$arCartPrice['BRAND']; //Presta init $logged = $context->cookie->__get('logged'); $id_cart = $context->cookie->__get('id_cart'); $id_lang = $context->cookie->__get('id_lang'); $id_guest = $context->cookie->__get('id_guest'); $id_currency = $context->cookie->__get('id_currency'); // Add cart if no cart found if (!$id_cart){ $context->cart = new Cart(); $context->cart->id_customer = $context->customer->id; $context->cart->id_currency = $id_currency; $context->cart->add(); if($context->cart->id){ $context->cookie->id_cart = (int)$context->cart->id; } $id_cart = (int)$context->cart->id; } $doAdd="Y"; //if(!$logged>0){$doAdd="N"; $TCore->arErrorMessages[] = 'You must be <a href="/index.php?controller=my-account">logged in</a> to buy products';} //if(trim($Reference)=='' OR !$Price>0 OR !$QUANTITY>0){$doAdd="N"; $TCore->arErrorMessages[] = 'Add to cart data is missing!';} if(!$id_cart>0){$doAdd="N"; ErAdd("Your cookie <b>id_cart</b> is wrong!",1);} if(!$id_lang>0){$doAdd="N"; ErAdd("Your cookie <b>id_lang</b> is wrong!",1);} if($doAdd!="N"){ //Check avail. tecdoc item in Presta $sql = 'SELECT p.`id_product`, pl.`name` FROM `'._DB_PREFIX_.'product` p LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product`) WHERE pl.`id_lang` = '.$id_lang.' AND p.`price` = '.$PriceVAT.' AND p.`reference` = "'.$Reference.'" '; $arRes = Db::getInstance()->executeS($sql); if(count($arRes)>0){ $NewTID = $arRes[0]['id_product']; }else{ //Supplier data (for 1C integration) $supplierName = $arCartPrice['SUPPLIER_STOCK']; /* $supplierId = SupplierCore::getIdByName($supplierName); if(!$supplierId){ $obSupp = new SupplierCore(null,$id_lang); $obSupp->name = $supplierName; $obSupp->active = 1; $obSupp->add(); $supplierId = $obSupp->id; }*/ //echo '<br><pre>';print_r($obSupp);echo '</pre>';die(); $obProduct = new Product(false,false,$id_lang); $obProduct->id_category_default = $DefaultCategory; $obProduct->id_category = $DefaultCategory; $obProduct->redirect_type = '404'; $obProduct->unity = $arCartPrice['ADD_URL']; // $obProduct->name = substr($arCartPrice['NAME'],0,128); // $obProduct->description = 'CARCONNECTION - ricambi auto per tutte le autovetture sul mercato a prezzi di concorrenza'; // $obProduct->description_short = $arCartPrice['SUPPLIER_STOCK'].' ['.$arCartPrice['DAY'].' days]'; $obProduct->price = $PriceVAT; $obProduct->show_price = 1; $obProduct->reference = $Reference; // $obProduct->link_rewrite = $arCartPrice['CPID']; $obProduct->available_for_order = 1; //true $obProduct->visibility = 'none'; //both $obProduct->is_virtual = 0; $obProduct->id_tax_rules_group = 8; //PhpMadman // Sets same texts for all languages $languages = Language::getLanguages(); foreach($languages as $lang) { $obProduct->name[$lang] = substr($arCartPrice['NAME'],0,128); $obProduct->description[$lang] = 'CARCONNECTION - ricambi auto per tutte le autovetture sul mercato a prezzi di concorrenza'; $obProduct->link_rewrite[$lang] = $arCartPrice['CPID']; $obProduct->description_short[$lang] = $arCartPrice['SUPPLIER_STOCK'].' ['.$arCartPrice['DAY'].' days]'; } if(isset($arCartPrice['OPTIONS']['WEIGHT']) AND $arCartPrice['OPTIONS']['WEIGHT']>0){$obProduct->weight = round($arCartPrice['OPTIONS']['WEIGHT']/1000,2);} if(isset($arCartPrice['OPTIONS']['MINIMUM']) AND $arCartPrice['OPTIONS']['MINIMUM']>0){$obProduct->minimal_quantity = $arCartPrice['OPTIONS']['MINIMUM']; $QUANTITY=$arCartPrice['OPTIONS']['MINIMUM'];} if(isset($arCartPrice['OPTIONS']['USED']) AND $arCartPrice['OPTIONS']['USED']>0){$obProduct->condition = 'used';} if(isset($arCartPrice['OPTIONS']['RESTORED']) AND $arCartPrice['OPTIONS']['RESTORED']>0){$obProduct->condition = 'refurbished';} //supplier //$obProduct->supplier_name = $supplierName; //$obProduct->id_supplier = $supplierId; //echo '<br><pre>';print_r($obProduct);echo '</pre>'; $obProduct->add(); if($obProduct->id>0){ $NewTID = $obProduct->id; $obProduct->addToCategories(array($DefaultCategory)); //$obProduct->setWsCategories(Array("id"=>$DefaultCategory)); //Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'category_product` (`id_category`, `id_product`, `position`) VALUES ('.$DefaultCategory.','.$NewTID.',0)'); //Add image if($arCartPrice['IMG_SRC']!='' AND $NewTID>0){ $shops = Shop::getShops(true, null, true); $image = new Image(); $image->id_product = $NewTID; $image->position = Image::getHighestPosition($NewTID)+1; $image->cover = true; // or false; if(($image->validateFields(false, true)) === true && ($image->validateFieldsLang(false, true)) === true && $image->add()){ $image->associateTo($shops); $tmpfile = tempnam(_PS_TMP_IMG_DIR_, 'ps_import'); if(Tools::copy($arCartPrice['IMG_SRC'], $tmpfile)){ $path = $image->getPathForCreation(); ImageManager::resize($tmpfile, $path.'.jpg'); } unlink($tmpfile); } } }else{ ErAdd("Prestashop new Item ID is false",1); } unset($obProduct); } if($NewTID>0){ if($arCartPrice['AVAILABLE_NUM']>0){StockAvailable::setQuantity($NewTID, false, $arCartPrice['AVAILABLE_NUM']);} $obCart = new Cart($id_cart); $obCart->id_lang = $id_lang; $obCart->id_currency = $id_currency; if($obCart->updateQty($QUANTITY,$NewTID)){ Header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); die(); }else{ ErAdd("Prestashop Add to Cart is false. NewTID=".$NewTID.', CartID="'.$id_cart.'"', 1); } } } } } ?> <script src="/<?=TDM_ROOT_DIR?>/media/js/jquery214.min.js"></script> <?php $_GET=Array(); $controller = new FrontController(); $tm=time(); $controller->init(); //echo 'init() '.(time()-$tm).' sec.<br>'; $tm=time(); //$controller->initContent(); //echo 'initContent() '.(time()-$tm).' sec.<br>'; $tm=time(); $controller->setMedia(); //$controller->initHeader(); $context->smarty->tpl_vars['page']->value['page_name'] = 'TDMod'; $context->smarty->tpl_vars['page']->value['meta']['title'] = TDM_TITLE; $context->smarty->tpl_vars['page']->value['meta']['description'] = TDM_DESCRIPTION; $context->smarty->tpl_vars['page']->value['meta']['keywords'] = TDM_KEYWORDS; $context->smarty->tpl_vars['page']->value['meta']['robots'] = ''; $controller->displayHeader(); //echo 'displayHeader() '.(time()-$tm).' sec.<br>'; $tm=time(); ?> <script src="/<?=TDM_ROOT_DIR?>/media/js/jquery214.min.js"></script> <script src="/<?=TDM_ROOT_DIR?>/media/js/colorbox/jquery.colorbox-min.js"></script> <link rel="stylesheet" href="/<?=TDM_ROOT_DIR?>/media/js/colorbox/cmain.css" /> <table><tr><td><?$arMSParams["LANG"]='it'; require_once($_SERVER["DOCUMENT_ROOT"].'/autoparts/addons/vin/component.php');?> </td><td> <?$arKTParams["LANG"]='it'; require_once($_SERVER["DOCUMENT_ROOT"].'/autoparts/addons/mselect/component.php');?> </table> <? require_once($_SERVER["DOCUMENT_ROOT"].'/autoparts/addons/vin/component.php'); ErShow(); echo $TDMContent; $controller->displayFooter(); /* $_GET=Array(); //require($_SERVER["DOCUMENT_ROOT"]."/header.php"); ob_start(); require($_SERVER["DOCUMENT_ROOT"]."/header.php"); ?> <script src="/<?=TDM_ROOT_DIR?>/media/js/jquery214.min.js"></script> <?php $PrestaHeader = ob_get_contents(); $PrestaHeader = str_replace(array('</body>','</html>'),'',$PrestaHeader); $PrestaHeader = str_replace('id="pagenotfound"','',$PrestaHeader); $PrestaHeader = str_replace('class="pagenotfound"','',$PrestaHeader); ob_end_clean(); echo $PrestaHeader; ?> <script src="/<?=TDM_ROOT_DIR?>/media/js/jquery214.min.js"></script> <script src="/<?=TDM_ROOT_DIR?>/media/js/colorbox/jquery.colorbox-min.js"></script> <link rel="stylesheet" href="/<?=TDM_ROOT_DIR?>/media/js/colorbox/cmain.css" /> <table><tr><td><?$arMSParams["LANG"]='it'; require_once($_SERVER["DOCUMENT_ROOT"].'/autoparts/addons/vin/component.php');?> </td><td> <?$arKTParams["LANG"]='it'; require_once($_SERVER["DOCUMENT_ROOT"].'/autoparts/addons/mselect/component.php');?> </table> <? require_once($_SERVER["DOCUMENT_ROOT"].'/autoparts/addons/vin/component.php'); ErShow(); echo $TDMContent; require($_SERVER["DOCUMENT_ROOT"]."/footer.php"); */ ?>
  23. Hi. Try grabbing version 1.0.1 from the first post. It should fix that issue.
  24. Hello All! I finally sat down and started coding again. I could not get the old version to work on PS 1.7, and I got so annoyed that I simply started over completely for PS 1.7. I cloned the bankwire wire payment module, and started rewriting it to MadSwish, just as I did for PS 1.6. And MadSwish 2.0.0 has now reached the state of 'But it worked on my Server', so there for you can now download the Beta. madswish.zip Download it, install it on a test server, and whack it around, and see if you can find any bu.. unexpected features. This version is only for PS 1.7 And if any unexpected features is found, I can't do any updates until monday.
  25. The %total% uses PrestaShop standard DisplayPrice function Either adjust your settings in PrestaShop or rewrite this function https://github.com/prestalab/universalpay/blob/master/controllers/front/payment.php#L42
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More