Search the Community
Showing results for tags 'functions'.
-
Hello. I've installed P.S. 1.7.8.9. In my backoffice, in the attributes and functions module, i cannot write the URL of the single attribute or of the single functions like it was on PS 1.7.7.2 How can i solve it?
- 2 replies
-
- functions variables
- functions
-
(and 3 more)
Tagged with:
-
On the website when i filter products using faceted search attributes and functions the module hides the attributes and functions that have no matching products. I would like them to always show so it is more clear to the customer what is selected and what the options are even if no products are found. Can anyone point me in the right direction where to do this? Prestashop version: 1.7.6.2
- 6 replies
-
- faceted search
- attributes
-
(and 1 more)
Tagged with:
-
Hi, guys! I'm an intern at a web development company. With other interns we're working with Prestashop. We've never seen it before and it causes us a lot of problems. We are usually told to modify something simple within CSS or a .tpl file, but recently we started to get tasks that are a bit too advanced for us. Not because these are hard, I can think of many solutions easily, but we know nothing of Smarty framework and how to use it properly. So I have to add a new functionality to the newsletter (ps_emailsubscription) module. After registering to it, the API has to generate a new one-use-only 5% discount voucher only for that specific user (Prestashop only allows to assign vouchers to registered users, so I added the 'email_user_unregistered' column to the 'ps_cart_rule' table). When that happens it has to either send and email with it to the specific user or display it inside of the JS modal mox that I've created (it shows up after successfull registration to the newsletter). I've found the functions that can help me accomplish my task: modules\ps_emailsubscription\ps_emailsubscription.php --> getSubscribers() classes\CartRule.php --> add() and others from classes\db as backup But I have no clue on how to call them within themes\PRS01\modules\ps_emailsubscription\views\templates\hook\ps_emailsubscription.tpl, which is where the view part of ps_emailsubscription module is located. What is the syntax? How should I do it? I'm a noob when it comes to OOP, I'm still trying to get used to it. There's the code from ps_emailsubscription.tpl: <div id="newslatter" class="col-sm-12"> <div class="block_newsletter"> <div class="row"> <div class="tt-content col-sm-5"> <h1 class="tt-title">{l s='Subscribe to our newsletter' d='Shop.Theme.Global'}</h1> </div> <div class="block_content col-sm-7"> <form action="{$urls.pages.index}#footer" method="post"> <div class="ttinput_newsletter"> <input class="btn btn-primary float-xs-right hidden-xs-down" name="submitNewsletter" type="submit" value="{l s='Subscribe' d='Shop.Theme.Actions'}" > <input class="btn btn-primary float-xs-right hidden-sm-up" name="submitNewsletter" type="submit" value="{l s='OK' d='Shop.Theme.Actions'}" > <div class="input-wrapper"> <input name="email" type="text" value="{$value}" placeholder="{l s='Enter your Email' d='Shop.Forms.Labels'}" aria-labelledby="block-newsletter-label" > </div> <input type="hidden" name="action" value="0"> <div class="clearfix"></div> </div> <div class="col-xs-12"> {if $conditions} <p class="newsletter-desc">{$conditions}</p> {/if} {if $msg} <p class="alert {if $nw_error}alert-danger{else}alert-success{/if}"> {$msg} <!-- MODAL BOX --> <div id="myModal" class="modal"> <div class="modal-content"> <div class="modal-header"> <span class="close">×</span> <h2>Registration successful!</h2> </div> <div class="modal-body"> <p>You've been assigned a 5% voucher!</p> <p>Voucher: CODE<b></b></p> </div> <div class="modal-footer"> <h3> Thanks! </h3> </div> </div> </div> {if $nw_error} {else} <!-- EXECUTES AFTER SUCCESFFUL REGISTRATION TO THE NEWSLETTER --> <script type="text/javascript"> var modal = document.getElementById('myModal'); var span = document.getElementsByClassName("close")[0]; modal.style.display = "block"; span.onclick = function() { modal.style.display = "none"; } window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } </script> <!-- WHERE THE REST OF THE SCRIPT HAS TO BE ADDED (I suppose) --> {/if} </p> {/if} </div> </form> </div> </div> </div> </div> Huge thanks in advance guys!
-
How can i catch the errors of these functions. When running on the backend you can see if something fails but since php I do not know how I can catch those error messages or that the operation has been a success. function loadProductsPost() { $_POST = array ( 'tab' => 'AdminImport', 'skip' => '1', 'csv' => 'productos.csv', 'forceIDs' => '0', 'match_ref' => '1', 'convert' => '', 'entity' => '1', 'separator' => ';', 'multiple_value_separator' => ',', 'iso_lang' => 'es', 'import' => 'Importar datos CSV', 'type_value' => array ( 0 => 'category', 1 => 'name', 2 => 'description_short', 3 => 'reference', 4 => 'ean13', 5 => 'weight', 6 => 'wholesale_price', 7 => 'price_tex', 8 => 'ecotax', 9 => 'manufacturer', 10 => 'image', ), ); } $import = New AdminImportController(); loadProductsPost(); $import->productImport(); //______________________________________CATEGORIAS function loadCategoriesPost() { $_POST = array ( 'tab' => 'AdminImport', 'skip' => '1', 'csv' => 'categorias.csv', 'forceIDs' => '1', 'convert' => '', 'entity' => '0', 'separator' => ';', 'multiple_value_separator' => ',', 'iso_lang' => 'es', 'import' => 'Importar datos CSV', 'type_value' => array ( 0 => 'id', 1 => 'active', 2 => 'name', 3 => 'parent', 4 => 'is_root_category', 5 => 'description', 6 => 'meta_title', 7 => 'meta_keywords', 8 => 'meta_description', 9 => 'link_rewrite', 10 => 'image', ), ); } $import = New AdminImportController(); loadCategoriesPost(); $import->categoryImport();
-
Hi All, I'm a new add-on developer and just getting started. I generated class documentation for the prestashop/classes directory. I would like to share this documentation with the community as I hope to become a valuable member and contributor. You can find Prestashop 1.6.1.4 Class Documentation at http://api.gmp.business/prestashop/ . Anyone that takes a look please feel free to reply with comments and suggestions. Thank you, Jimmy Warren Jr. GMP Domain Technician
- 1 reply
-
- 1
-
-
- prestashop variables
- class hierarchy
- (and 8 more)
-
Hi All, I'm a new add-on developer and just getting started. I generated class documentation for the prestashop/classes directory. I would like to share this documentation with the community as I hope to become a valuable member and contributor. You can find Prestashop 1.6.1.4 Class Documentation at http://api.gmp.business/prestashop/ . Anyone that takes a look please feel free to reply with comments and suggestions. Thank you, Jimmy Warren Jr. GMP Domain Technician
- 2 replies
-
- 1
-
-
- data structures
- data fields
- (and 8 more)
-
[SOLVED] Prestashop Validator Issue for Library files.
Raghubendra posted a topic in Core developers
I have developed a new module for prestashop and it is using dompdf library for generating pdf. When I validate the module then I get some compatibility issues that are pointing to some errors that say: 'Class 'PDFLib' does not exists' 'Function 'pg_query()' does not exists' 'Function 'pg_escape_string()' does not exists' The above errors are coming in various files withing the dompdf library and I do not find a way to fix them. Please help. -
Hi there, I am using the default theme to set up my webshop. At the beginnin I see the add to cart function. Customer can add to cart and go to check out. But after a while, on the way I am configure other basic information, when I come back to view my site. The function "Add to cart" disappeared. I do not know why. Can anyone help? Thank a lot!
-
Hi everyone again, Now i have a simple question, im trying to organize my code in my module, and i want to do my own functions, but no matter how i create and call the functions, is not working. public function __construct() { public function install() { public function unistall() { public function displayForm() { public function myTest() { $output = null; $output .= $this->displayError($this->l('test')); } public function getContent() { $output = null; if (Tools::isSubmit('submit' . $this->name)) { $this->myTest(); $output .= $this->displayError($this->l('test')); ETC ETC. As you can see, i have the normal methods, and my own method called myTets(). In the getContent method, i have the call to my method, folowed by the same line i have in my method. One is showing, the other not. I think i'm not doing anything wrong, just calling the function. Thanks in advance as always!
-
Prestashop v1.6 finally has a "how to" book that not only covers the basics of running a Prestashop store but also documents all the main methods and functions: http://www.amazon.com/Prestashop-v1-6-Under-Hood-developers-ebook/dp/B00KEDX01O/ref=sr_1_11?ie=UTF8&qid=1400395157&sr=8-11&keywords=prestashop
- 2 replies
-
- kindle
- prestashop
- (and 7 more)
-
Hello, There doesn't seem to be any way to assign more than one value to a product feature. I have products that use features like "Suitable for" and those require to have more than one Value assigned. Comma-separating those values isn't a good idea as I won't to enable customers to filter by features (like Suitability) with the help of the Layered Navigation Module. Is there any known workaround for those limitations?