-
Posts
347 -
Joined
-
Last visited
-
Days Won
18
Content Type
Profiles
Forums
Gallery
Downloads
Articles
Store
Blogs
Everything posted by Wartin
-
Hello. Is it normal that every time I change some configuration in one carrier it changes its ID?. I've just edited one to change it's title and now its ID is 41, not 40 as before editing. TB 1.1.x here. Thanks
-
Hello. A month ago I saw a store that showed thumbnails of the products listed as you type. I tried to do it, and found this: https://www.prestashop.com/forums/topic/511807-add-images-in-search-bar/ After changing some variable and fields names I managed to make it work, but changing /classes/Search.php. Now I know how to make overrides, here is the explanation for Niara theme. Again if there are changes to make it work better just tell me. First we change one query and then the js code to show the products with the image. 1) copy classes/Search.php to override/classes/ 2) edit override/classes/Search.php, change this line: class SearchCore to class Search extends SearchCore 3) go to this if ($ajax) { ... } and change the whole block to: if ($ajax) { $sql = 'SELECT DISTINCT p.id_product, pl.name pname, cl.name cname, cl.link_rewrite crewrite, pl.link_rewrite prewrite '.$score.', pi.id_image pimg FROM '._DB_PREFIX_.'product p INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON ( p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int) $idLang.Shop::addSqlRestrictionOnLang('pl').' ) '.Shop::addSqlAssociation('product', 'p').' INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON ( product_shop.`id_category_default` = cl.`id_category` AND cl.`id_lang` = '.(int) $idLang.Shop::addSqlRestrictionOnLang('cl').' ) INNER JOIN `'._DB_PREFIX_.'image` pi ON ( p.`id_product` = pi.`id_product` AND position = 1 ) WHERE p.`id_product` '.$productPool.' ORDER BY position DESC LIMIT 10'; return $db->executeS($sql, true, false); } Delete every function but the one we changed. At the bottom don't forget to leave a '}' to close the class definition. In order to make TB take the override, delete /cache/class_index.php We've made the query that now contains our product's image. Now we have to show it. Edit /themes/niara/js/modules/blocksearch/blocksearch.js And change this: parse: function(data) { return data.map(function(product) { return { data: product, value: product.cname + ' > ' + product.pname }; }); }, with: parse: function(data) { return data.map(function(product) { return { data: product, value: '<img src="https://YOUR-STORE/img/p/4/2/' + product.pimg + '-Niara_small.jpg" /> ' + product.cname + ' > ' + product.pname }; }); }, Now just type something it the search bar, wait a second and look all the products appear with its images :) Search.php
-
- 1
-
-
Great, @datakick, I made those changes. Very important to call the parent, and it's easier to understand what the override does. Thanks!
-
Well, I could solve the second question, about using one specific carrier for one (or more) cities (in fact postal codes). I followed this post: https://www.prestashop.com/forums/topic/160695-solved-carrier-by-postcode-the-easy-way/ but didn't work, so I'll write my steps. It's my first override, if there is something wrong just tell me, please. 1) Go to Localization -> Zone. Add a new one. In my case I used the name of my city. It could be anything. Remember the Zone ID of this zone, we'll need it. 2) Go to Transport -> Carriers. Create a new carrier, and select just the zone we've just created. Put some price and weight ranges. Select 'most expensive' in out-of-range (It doesn't work if you don't, I don't know why) 3) Copy "classes/Address.php" to "override/classes/Address.php". 4) In line 37 change: class AddressCore extends ObjectModel to: class Address extends AddressCore Add a } in line 353 (at the very end of the function getZoneById() delete lines 39-309 Line 322, function getZoneById($idAddress), we'll add some lines at start. 2450 is the Postal Code of the city you want to use with a specific Carrier (change it with yours). As it's an array, it could be more than one postal code (just separate them with commas). where it says '9', write your new Zone ID public static function getZoneById($idAddress) { $postcode=self::getPostcodeByAddress($idAddress); if(in_array($postcode,array(2450))){ return 9; } else{ Now go just before the function getZoneByAddress, and add this function: /** * Return postcode of address * * @param $id_address Address id * @return integer postcode */ public static function getPostcodeByAddress($id_address){ $row = Db::getInstance()->getRow(' SELECT `postcode` FROM '._DB_PREFIX_.'address a WHERE a.`id_address` = '.(int)($id_address)); return $row['postcode']; } Ready. As we have changed some code, we need to make TB read the changes. Delete /cache/class_index.php Go and try to checkout, it should show the carrier you made specially for our new zone. Address.php
-
Hi, I've just seen this module: https://store.thirtybees.com/shop-modules/shipping/localized-shipping It says that can import rates with .CSV, and I remembered having read your post. Maybe it's useful.
-
Hello. I'm trying to set carriers in TB 1.1.x. I can't find a module for TB nor PS that manages shipment costs in Argentina. I did find an SDK (Andreani's) that can make queries to ask for the price, based on postal code. Also, I found a module for Magento and an old version of MercadoPago's module that had shipping management (but doesn't work anymore, and had payment too). Two questions: 1) is there a shipping module structure that I can use to adapt the queries and create a module for using this API? I managed to print in product's page the shipping price that is given to me in JSON format (using Andreani's API), but that's not enough. 2) is it posible to set carriers based on just one City? locally we want to send the packages without using mail, as there are cheap services we prefer. I read about how to make it by countries (making a new zone and moving the country and it's states in) Any help will be really appreciated. Thank you in advance.
-
Lo que no consigo es calcular el costo de envío. Al parecer las últimas versiones del módulo no trae este cálculo, solo permite cobrar. En github encontré algunos repositorios que en teoría lo hacen, pero usan una versión muy vieja. Para envío en Argentina vi que Andreani tiene un SDK y un módulo para Magenta, nada para PS o TB. Si alguno/a encuentra la forma sería bueno compartirlo. Saludos!
-
Las zonas tienen dentro países y algunos países tienen provincias. Todo eso está en el menú que andás utilizando Ahora bien, qué transportistas tenés creados en Transporte-> transportistas? Qué zonas tienen activadas? La verdad es que nunca había agregado los transportistas en los productos como veo que estás haciendo. Sino que al finalizar la orden (desde el frontoffice) te pregunta qué transportistas de los que pueden enviar en la zona donde está el país donde vive el comprador.
-
Thirtybees does not call SKUs as SKU. It is "reference" column
-
Lo tengo! Volvé a poner el id="colorlabel" como hicimos antes en el template. En el JS la función queda: $(document).on('click', '.color_pick', function(e) { e.preventDefault(); colorPickerClick($(this)); findCombination(); getProductAttribute(); document.getElementById('colorlabel').innerHTML = $(this).attr('title'); }); Ahi agarramos el 'title' de donde hacemos el clic, así no hay q esperar que cambie el URI. Contame qué tal :)
-
Hola. Cuando no escribo una dirección en el campo de crear una cuenta o escribo una incorrecta aparecen los mensajes de validación "Please fill out..." o "Please enter an email address". Buscando en internet encontré que se pueden traducir los mensajes al español, y finalmente encontré este archivo en TB: js/jquery/plugins/validate/localization/messages_es.js donde aparecen todas las cadenas traducidas, y en ese directorio todos los idiomas, pero por algún motivo no están siendo utilizadas. ¿Les pasa lo mismo? ¿Saben cómo arreglarlo? Gracias de antemano.
-
Comento en el foro en español por si otros tienen el mismo problema. Hoy hicieron un commit en el código de TB con la solución a las traducciones que desaparecían. El problema era que al guardar las traducciones en una sección, por ejemplo Products-algo se borraban todas las otras secciones que empezaban con Products-. Con este arreglo ya no sucede: Saludos!
-
- 1
-
-
Exacto, eso es lo que agregué en la segunda Post Data. Toma el color de la dirección del producto. por eso anda cuando hacés clic dos veces, porque lo toma de ahi. Fijate que en tu Tema no tenés que poner "Color:", sino solo document.getElementById('colorlabel').innerHTML = decodeURIComponent(tabValues[0][2]); Entonces vas a tener que seguir buscando, quién es la función que actualiza el URL del producto. Esa función es la que tiene q ejecutar esa línea de acá arriba.
-
Ha! I swear I read it dozens of times! Thank you :)
-
Je, tuvimos suerte, me salió. En el products.js andá a la función que estábamos editando y: $(document).on('click', '.color_pick', function(e) { e.preventDefault(); colorPickerClick($(this)); findCombination(); getProductAttribute(); document.getElementById('colorlabel').innerHTML = 'Color: ' + decodeURIComponent(tabValues[0][2]); }); Y en el .tpl de tu tema agregá el id="colorlabel" donde querés escribir. No era tan simple, el decodeURI lee la dirección, que si te fijás cuando cambia de color aparece otra. En mi caso agrega: #/30-color-azul cuando apreto azul. lo descubrí mirando un poco más abajo, en la función checkUrl() Saludos PD: tené en cuenta que estamos agregando a los atributos ese ID. Si tuvieses más de un atributo (talle, por ejemplo) tal vez no deberíamos usar el ID ahi mismo, sino buscar quién está sobre el "color_to_pick_list". PD2: probé cambiar los archivos en mi tienda y funciona al segundo clic. Supongo que tendrás que seguir buscando cuándo escribir bien el label. Pero lo bueno es que ya tenés el string del color.
-
Hi @toplakd. I'm trying your partial solution, but I don't get what should I delete/comment, as @gatasi asked. Which line of the three? I'm tired of re translating strings every time I have to change something. It should be taken into account, It's always necessary to change some strings in order to adapt the platform. After working like two months I have 264 untranslated strings in spanish, I re entered by hand from a new TB instalations but... they keep cleaning when I change something. It just erased like 30 strings, after changing one string... It's annoying and time consuming. Thanks!
-
Es que necesitás hacer un par de cosas. Primero agregar en la función esa algo que modifique la línea del Label. Acá hice una prueba, en el template del productos (themes/niara/products.tpl) agregué un ID para la etiqueta, para que muestre: <label id="tin" class="attribute_label">color!</label> Y después la parte de JS, en el archivo themes/niara/js/product.js línea 355, puse esto $(document).on('click', '.color_pick', function(e) { e.preventDefault(); colorPickerClick($(this)); findCombination(); getProductAttribute(); document.getElementById('tin').innerHTML = 'color!'; }); La última línea hace q al apretar el color cambie la etiqueta. Te falta nomás que, en vez de "color!" escriba el color que apretaste, que creo q es el dato que tenías en el comienzo. Saludos
-
I see... I didn't think about where to store it... those are likely too much changes. I have read 3-step thread, but I didn't try it yet. I should do it before launching the site... thanks. About asking for the telephone, in my case I will ask it later in the checkout (or address creation), so it will be mandatory anyway. I read somewhere that it's better to make clients create accounts and forbid guest accounts, I'm not sure, though.
-
Hola! No traigo la respuesta, pero tal vez ayude. Al apretar un botón de color ejecuta una función en javascript (en niara/js/product.js), usando el depurador de firefox (f12, pero con control-shift-c podés marcar un color y ves qué se ejecutaría de apretarse, donde dice 'event') veo esto: function(e) { e.preventDefault(); colorPickerClick($(this)); findCombination(); getProductAttribute(); } Si querés escribir el color vas a tener que buscar qué botón se apreta y reescribir el <label class="attribute_label">Color </label> para que diga el color al lado. Ojalá sirva. Saludos!
-
Hello, I'm using 'Just account creation' (I'm not sure if it's like that in english) to let the users create an account with minimal data asking. I'd like to ask for telephone there, and not later in address creation. I tried to add it in authentication-create.tpl template, but obviously it's not saved nor javascript checked. Is it posible? Thanks!
-
Hola. Quisiera saber si pudieron traducir los botones que hay para subir archivos, tanto en el formulario de contacto como en la Personalización de productos. Estoy usando Niara, se ve así (toque'el css para q por lo menos el botón que dice 'Browse...' aparezca centrado verticalmente. Saludos y gracias.
-
How can i add quantity buttons (+, - ) per product row in the cart dropdown ?
Wartin replied to d3s1gn3r's question in Theme help
Hello. Maybe you can add those events in Preferences -> Custom Code -> JS? as the code needs to be loaded in every page, it could work... -
Hello. I'm trying to change the text that appears in buttons to browse for files, for example in Customization files and in Contact form. It says 'Browse...' and 'no file selected'. In translations I see those strings, and they are translated. I centered the button using CSS, because it didn't fit the square before that. I'm using Niara. Thanks!