Jump to content

shaft

Members
  • Posts

    72
  • Joined

  • Last visited

shaft's Achievements

Newbie

Newbie (1/14)

7

Reputation

  1. So after trying next hours it is a simple way. Problem was in table called "to" and "from" ... It is a same name in MySQL syntax. In my case: $foreach_speci_price = "2"; $get_speci_to = Db::getInstance()->getValue('SELECT `to` FROM '._DB_PREFIX_.'specific_price WHERE id_specific_price = \''.pSQL($foreach_speci_price).'\''); echo $get_speci_to; Maybe it help someone. Marked as SOLVED.
  2. Hi, I am writting a script, that use a db. Last 2 hours I trying to get a value in datetime "from" and "to" column, but withnout sucess. Trying like this: $foreach_speci_price = "2"; $get_speci_to = Db::getInstance()->getValue('SELECT to FROM '._DB_PREFIX_.'specific_price WHERE id_specific_price = \''.pSQL($foreach_speci_price).'\''); echo $get_speci_to; But it is not working. Can anyone help? Thank you. Shaft :-)
  3. Hello, this is what I looking too. I have combination, so I have to change product.js in "themes/your_theme/js/product.js Original: Line 741: if (priceWithDiscountsWithoutTax != priceWithGroupReductionWithoutTax) { if (combination.specific_price.reduction_type == 'amount') { $('#reduction_amount_display').html('-' + formatCurrency(+discountValue * currencyRate, currencyFormat, currencySign, currencyBlank)); $('#reduction_amount').show(); } else { var toFix = 2; if ((parseFloat(discountPercentage).toFixed(2) - parseFloat(discountPercentage).toFixed(0)) == 0) toFix = 0; $('#reduction_percent_display').html('-' + parseFloat(discountPercentage).toFixed(toFix) + '%'); $('#reduction_percent').show(); } } To: if (priceWithDiscountsWithoutTax != priceWithGroupReductionWithoutTax) { if (combination.specific_price.reduction_type == 'percentage') { $('#reduction_amount_display').html('-' + formatCurrency(+discountValue * currencyRate, currencyFormat, currencySign, currencyBlank)); $('#reduction_amount').show(); } else { var toFix = 0; if ((parseFloat(discountPercentage).toFixed(0) - parseFloat(discountPercentage).toFixed(0)) == 0) toFix = 0; $('#reduction_percent_display').html('-' + parseFloat(discountPercentage).toFixed(toFix) + '%'); $('#reduction_percent').show(); } } Also I use round percentage to all number. :-) Thank you. Prestashop 1.6.0.14. Regards Shaft
  4. Hello, thank you for this tutorial. It WORKS very good! ;-) Prestashop v 1.6.0.14. PS: Do you know, how to get a image "cart" in clickable link to "cart" in scroll down menu. Just like in a image bellow? :-)
  5. I think so no. Becose this is first time, what I create a function and apply a varialbe to .tpl. So I do not know, what excatly run if I create it. Can you help me please, what run to register new function and apply to .tpl? Thank you, Regards, Shaft :-)
  6. Hello, I am trying to create a variable background with image 1.jpg,2.jpg,3.jpg,4.jpg etc.. First what I do a function inside FrontController.php like this: public function randomBackground() { //add variable background $bg = array('_1.jpg', '_2.jpg', '_3.jpg' ); // array of filenames $i = rand(0, count($bg)-1); // generate random number size of the array $selectedBg = "$bg[$i]"; // set variable equal to which random filename was chosen $this->context->smarty->assign(array( 'background_random' => $selectedBg, )); } Second I style and change header.tpl (..yourtheme/header.tpl) like this: <div class="columns-container" style="background: url('../themes/default-bootstrap/img/bg/{$background_random|escape:'html':'UTF-8'}') center no-repeat fixed #FFF;background-size: cover;"> But it does not work. If I load a page and view a console I got this: <div class="columns-container" style="background: url('../themes/default-bootstrap/img/bg/ Notice: Undefined index: background_random in /var/www/clients/client1/web1/web/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 184 Notice: Trying to get property of non-object in /var/www/clients/client1/web1/web/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 184 ') center no-repeat fixed #FFF;background-size: cover;">........</div> Any idea, how to fix it? Thank you Shaft :-)
  7. Hello, I have a write script for xml import product from supplier and work fine under 1.6.0.x version with class. I wanted to use a script for this new version 1.6.1.0 and now I get this error "Fatal error: Class 'Context' not found in /srv/www/example.com/public/www/init.php on line 21. This is sample of script code: $presto_init = array("ObjectModel", "webservice/WebserviceRequest", "Tools", "shop/Shop", "db/Db", "db/DbPDO", "Context", "Configuration"); require_once('config/alias.php'); require_once('config/defines.inc.php'); require_once('config/settings.inc.php'); include('init.php'); ini_set('display_errors', 'on'); error_reporting(E_ALL | E_STRICT); class Worker { public static function loadPrestaShopClass($path) { require_once("classes/".$path.".php"); $file = explode("/", $path); $class = end($file); class_alias($class."Core", $class); return $class; } } Does anyone know, what Prestashop change in this version and how to change it to work? Thank you for your reply. Regards Shaft
  8. Zdravím, zkuste zvětšit min-height na větší výšku z defaultně v šabloně nastavených 344px na například 500px. Pokud používáte default template - "themes/default_bootstrap/css/global.css" toto: #facebook_block,#cmsinfo_block. V tom změňte hodnotu min-height na vyšší. S pozdravem Shaft
  9. Aby bylo políčko zaškrtnuté primárně, tak bych hledal někde v souboru your_theme/authetication.tpl něco jako newsletter v kódu. Osobně jsem to nedělal, ale bude to určitě možné.
  10. Řešil bych to přidáním úplně nového pole do kódu a to označil jako IČ. Následně bych dal pryč to původní IČ.
  11. Hi, i need help with TinyMce resolved this problem in Prestashop. This is for template to use in Ebay, allegro etc. automatic auction. I just create a html template with css style inside. For example: <style type="text/css"><!-- #page_aukro { width:100%; border:1px solid black; min-width: 600px; max-height: 6000px; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABZJREFUeNpi2r9//38gYGAEESAAEGAAasgJOgzOKCoAAAAASUVORK5CYII=); } --></style> <div id="page_aukro"> Content ..... </div> Now if I save this template inside Prestashop - using TinyMce editor (paste in HTML code) remove tag and stay just this: <div id="page_aukro"> Content .... </div> How and where to make a exception for TinyMce to do not remove tag ? I was searching all day and trying but without sucess. Thank you for your help. Regards, Shaft
  12. I was trying do something in "controllers/front/AddressController.php" and "controllers/front/AuthController.php" like: If company is set, no need to validate a first name and last name, else first name and last name is required. But withnout success... :/
  13. Hello, I would need advice on how to set not required fields for first name and last name, if the customer fills the company field. -------------------------------- For example 1: The customer fills in the order: Company: XYZ First name: "empty" // not required Last name: "empty" // not required Adress line: XYZ ZIP CODE: XYZ City: XYZ State : XYZ etc.... For example 2: Company: XYZ First name: XYZ // they can fill, but not required Last name: XYZ // they can fill, but not required Adress line: XYZ ZIP CODE: XYZ City: XYZ State : XYZ etc.... For example 3: Company: "empty" First name: XYZ //now it is required Last name: XYZ //now it is required Adress line: XYZ ZIP CODE: XYZ City: XYZ State : XYZ etc.... ----------- Anybody know, how to do that? Prestashop version 1.6.0.7. I think this will help more people. Thank you, for your answer. Best regards, Shaft
  14. Můžu tě prosímtě ještě poprosit, jestli nevíš, v jakých souborech se dají takto upravit ceny v "košíku" a pokladně první krok souhrn objednávky. Zkoušel jsem upravovat v themes/moje_tema/modules/blockcart/ soubor .tpl kde bylo convertPrice a není zatím žádný vliv.... Jinak na stránce produktu toto funguje skvěle. Děkuji :-)
×
×
  • Create New...