-
Posts
88 -
Joined
-
Last visited
Everything posted by Luis C
-
No prob. But I mean... there ARE modules available, however they will most probably charge monthly usage, since there isn't a single tracking API out there that's 100% free... They all offer like 10, 50, 100 free trackings a month and then charge for the rest of the API usage. Please look for Aftership module and I remember one called Tracking center.
-
Hi, that will depend on your template.. Please share the code that renders that number on the page so we can help you properly. For starters, if a simple variable is used in a smarty template, you can use modifiers like number_format to make it look as you wish. {$my_variable|number_format:2:".":","} = 4.00
-
Hi, It's possible to achieve, nothing that hasn't been made before. However, if more than a single shipping company/carrier is being used in the store, it could be a bit more difficult / expensive. I mean... to be able to query the carriers database you need API access to their webservices, and not every carrier can or will offer access to their tracking API (Though your customer is the one who must negotiate with the carriers) The other alternative, and the more expensive one, is using a multi-carrier tracking API and writing a module to: 1) When the tracking number is added to prestashop, add a record on their tracking service database to retrieve afterwards 2) fetch the information when the customer visits the order page, and/or when a tracking email is being sent to the customer. You can also program different webhooks and/or tasks to check for tracking updates and send emails to the shopper accordingly. There are multiple services that will allow you to either register a tracking number and the carrier, or directly check the tracking status at any given point in time with an HTTP request (using curl, or whatever) Aftership, trackingmore, 17track... Please take into consideration both options should require to write a custom module (I'm not sure, but I don't think there's a ready-made one alrady available) The first option, if your customer can get access to their carriers APIs would be cheaper, since multi-carrier tracking services are kinda expensive, depending on the number of tracking requests are needed per month.
-
Como te comentaba, creo que id no es un índice disponible en el objeto customer desde smarty, mea culpa, así que tendrás que usar email. De todos modos la sintaxis no es correcta: {if $customer.is_logged && $customer.email == 'xxxx@xxxx'} {/if} o bien anidas las comprobaciones {if $customer.is_logged} {if $customer.email == 'xxxx@xxxx'} Mi contenido {/if} {/if} (Si no tienes que mostrar nada al resto puedes obviar el else)
-
En la lista de variables globales tienes también la info de cliente accediendo a $customer. Si haces {$customer|var_dump} en un template (o dump si lo quieres con formato "molon") volcarás todo el contenido del objeto en la página y podrás ver la clave que necesitas usar para diferenciar al cliente, o bien por email, o por ID (es lo más común) En ese sentido, dentro del condicional if $customer.is_logged pondrías otro condicional del tipo "if $customer.id == XXX" o "if $customer.email == XXXXXXX@XXXXXX" y dentro el contenido que quieras ofrecer a ese cliente en particular. EDIT: Ahora que lo pienso, creo que al id no se puede acceder desde smarty en un template, así que lo suyo sería hacer {if $customer.email == 'XXXX@XXXX'} {/if}
-
Hey. Bumping up this thread just because I was looking into coupon creation myself and just came upon this topic. In case anyone finds it useful, the following would be the method to specify which groups your cart rule is restricted to. Once we've added our coupon, we need to take note of our cart rule ID. We can simply call the object and the item inside ($rule->id) or declare a variable for later use, if that fits your code better: $cart_rule_id = $rule->id Now, to specify the groups, we need to add them to the _group_restriction table in your database (this refers to Prestashop 1.7). To do so we declare a variable with the group or groups we want to restrict the cart rule to, eg: $restricted_groups = 3; or $restricted_groups = [3,5,12]; If there's just one ID in the variable, we call the DB class and insert the record, if the variable is an array of IDs we loop through it and do the same for each one: Db::getInstance()->execute(' INSERT INTO '._DB_PREFIX_.'cart_rule_group (id_cart_rule, id_group) VALUES ('.(int)$cart_rule_id.', '.(int)$id_group_restriction.') '); OR foreach($restricted_groups as $group) { Db::getInstance()->execute(' INSERT INTO '._DB_PREFIX_.'cart_rule_group (id_cart_rule, id_group) VALUES ('.(int)$cart_rule_id.', '.(int)$group.') '); } That should do the trick.
- 2 replies
-
- prestashop 1.7
- module
-
(and 1 more)
Tagged with:
-
Your website uses a full width theme. In order to restrict the banners to a boxed container you need to wrap it in a <div class="container"> element. Check your templates/layouts folder. You should be able to find the hook (or the template file) your banners module is hooked to, and from there just as I said, wrap it in a new div with class "container".
-
Wholesale price depending on minimum quantity
Luis C replied to Paul Albers's topic in Core developers
I'm not sure I'm understanding well OP's needs, or if you need exactly the same, but, well... Prestashop already offers different wholesale prices using specific prices. You can set up different prices depending on product qty, as I show in the following screenshot: -
Es una buena práctica mantener la atribución al origen del software que estás utilizando, en este caso licenciado bajo OSL3.0. En cualquier caso, cada template puede implementar este enlace de maneras distintas. En este caso ese enlace depende de uno de los modulos que se instala automáticamente, y puede ser modificado y eliminado (De nuevo, no lo recomiendo porque el template también tiene su licencia) en el archivo footer_block.tpl que encontrarás en el directorio del módulo
-
Best way to develop a module
Luis C replied to bk_developer's topic in Addons, modules and themes developers
If you have a clear view of what you want to achieve, creating your own module from zero is the way to go. If you have any trouble constructing your module, start by using Prestashop's Module generator. This will give you an "skeleton" so you can start developing your own functions. https://validator.prestashop.com/generator The most important thing is having prestashop's documentation at hand. Start here, https://devdocs.prestashop.com/1.7/modules/ -
Get product discount on CMS page.
Luis C replied to Kelsier's topic in Addons, modules and themes developers
That's how modules work after all. You call your hook from a theme template file, then your module calls its own template file. At any rate, correct me if I'm wrong, but you can't assign a smarty variable inside a module, and then use it in a theme template file outside your module, because you've assigned that variable inside a method/function, and you can only use it if you make an instance of the class (yourModule class). If storing a loop inside your object/variable is all your module does, you're safe removing your "Return $caronteProducts" line and adding return $this->display(__FILE__, 'file.tpl'); it should not make an infinite loop. If you feel safe doing so, please share your module main php file and I'll take a look -
Hola: En 1.6 lo que puedes hacer es, en lugar de utilizar un transportista con un baremo de importe para el envío gratis, crear un cupón de envío gratis a partir de X importe (regla de carrito) No le pongas código, y se aplicará automáticamente una vez se cumpla el requisito (importe sin envío >= 95€) Anula la compatibilidad con otras reglas de carrito (o actívala y solo añade las reglas que quieras) y en los descuentos automáticos, procura que se creen sin compatibilidad con otras reglas de carrito. De ese modo, incluso si el cliente mete el código del cupón, no le permitiría canjearlo
-
Get product discount on CMS page.
Luis C replied to Kelsier's topic in Addons, modules and themes developers
Can you please create a template file inside your module's folder and call it instead of returning the object you just created? (return $caronteProducts) return $this->display(__FILE__, 'file.tpl'); Then try to var_dump the object from your newly created template file. If you hooked your module to "displayCaronteCategories" and it's correctly registered you should get a result, unless your object does not contain data. Let me know -
Automatic emails not sending (chante order status)
Luis C replied to rafaelvines's topic in General topics
Hi, if you receive the test email when you press the corresponding button, PHP mail() is working fine. Please check one thing for me. If you enable DEBUG MODE in -> Adavanced parameters -> performance, can you tell me if you still receive the same error, or a blank page with the message "Error: invalid e-mail template" instead? -
This should do it. Use it in your custom.css Style your header elements separately and adjust according to your needs @media (min-width:1200px) and (max-width:1439px) { #header_primary_container { width:100vw; margin-left:0 !important; margin-right:0 !important; max-width: 100vw !important; /* Padding will stay the same so you can have a safe "bleed" from the edges of the browser window */ } .st_mega_menu_container > .container { margin-left: 0; margin-right: 0 !important; } .st_mega_menu_container #top_extra_container { width:100vw; } }
-
Your syntax is incorrect. Using one operator (=) in an if statement, makes it always return true, so it alway process the code inside. Besides, there is no global variable that stores the shop ID, so if you're not writing a module and just want to edit template files you need to change the way you determine what shop is currently being accessed. Depending on the version of your prestashop installation the variable name is different. For Prestashop 1.7, you can use these to differentiate between shops in a multi-store environment: {$shop.name} - If your stores have different names, you can use this one to detect what store is being accessed and display content consequently {$shop.base_url} - the same, if your stores have different URLs (they should) this one will also allow you to make a conditional statement to show content based on store. At any rate, please remember to use a double operator (==) since it's the one that "compares".
-
There are several ways to achieve your goal. You can assign a new class to your header container (If it's based on bootstrap it should be already classed .container) and then write the corresponding media query in your custom.css or global.css depending on your prestashop version. @media (min-width:1200px) and (max-width:1489px) { .myclass { width:100vw; } }
-
Hi... it seems to be a bug in the latest version of Chrome. You can still check the stay logged button by clicking on the area it *SHOULD* be located / was originally located. There's a mismatch between the DOM and the representation on the screen. It's got more to do with the browser than Prestashop. Did you ever reproduce this issue in other browsers?
-
Category list disappears when on product page. [SOLVED]
Luis C replied to Layton's topic in Configuring and using PrestaShop
Hahah, don’t worry about it. Anyways if you click edit on your first post it should allow you to edit the post title aswell -
Category list disappears when on product page. [SOLVED]
Luis C replied to Layton's topic in Configuring and using PrestaShop
Absolutely no problem. Glad it was useful. If you could edit the original post title and add [SOLVED] it'd be great. -
Category list disappears when on product page. [SOLVED]
Luis C replied to Layton's topic in Configuring and using PrestaShop
Hi, Layton. Please notice that most probably the hook where blockcategories module is attached to is not available in the product page. That's the main cause for it not appearing. It should be already hooked to displayLeftColumn, and you need to also hook it to displayLeftColumnProduct if you want it to appear in your product page. -
Prestashop 1.7.8.3 how truncate product title
Luis C replied to peter4661's topic in Addons, modules and themes developers
Please, be aware that the product name is called in several places and files. Depending on what you want to change, you must modify the correct file and instance of {$product.name} Truncate MUST work because it's just a php modifier included in smarty, so you should be able to truncate any string. If you can elaborate where you want the product title to be shortened, we might have a chance to help you. -
Wrong hyperlink conversion
Luis C replied to karo111's topic in Addons, modules and themes developers
Hey Karo... that's not a Prestashop issue... It's your email client / provider or even the app/browser you're using the one that converts the text into a link, because... wel... it basically is a URL. Try adding spaces between the dot and both parts of the URL my-shop . pl