Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/16/2021 in all areas

  1. This is not a module but a script/program. Follow the installation instructions! Prestools Suite is a suite of user-friendly and powerful tools to mass edit your products, orders and categories. It has also many other functions. It runs outside the Prestashops backoffice so that it won't be affected by bugs in your shop and can be extra fast. The main parts are: product-edit: great options for mass editing more than 50 product fields. Add categories, change prices, update descriptions - for hundreds of products at once. Also great search options and the possibility to export as csv. product-sort: an easy way to sort products inside a category. From position 500 to 1 in a blink. With the visual sort option you can see immediately how things will look. order-edit: adding and deleting products and changing prices without problems. order-search: make a selection on carrier, payment type, status, etc. or just search. With csv export option. category-edit: useful for editing metadata and descriptions for SEO combi-edit: assign pictures to your combinations quickly combi-copy and combi-delete: copy, modify and delete attribute combinations using one product as a template regenerate images for selections of products. Get better quality with Imagic when installed. cleanup images: save on disk space by cleaning up images of deleted products cleanup: make your shop quick and lean shop rescue: turn off overrides and non-Prestashop modules when due to some bug you can no longer login in the backoffce. attribute-list and feature-list: see how many products use each feature and attribute and get a product list. prodcombi: see and modify the attributes of many products eu-tax: get a quick overview how much you sold in each of the EU countries and how much VAT you withheld in the process override-list and module-list: get lists of modules and of overrides and the modules might own them. integrity checks: find and fix database and file corruption. empty the cache: useful when a bug locks you out of the backoffice and a lot of statistics. Installation: Unzip the downloaded file and copy the resulting files to a subdirectory below your admin directory (do not install as a PS module!). Edit Settings1.php. Put in your own username, password and for extra protection IP address. You can access the program's login screen in the browser like "www.myshop.com/myadmin/mydir/login1.php". Both the main software and the paid plugins are regularly updated. Make sure that you always download them simultaneously as otherwise mismatches may cause problems. The default username is "[email protected]" and the default password is "opensecret". Use of product-edit: At the top of the page is the search block: there are many options to select the products you want to edit. Press the search button to execute. The default is hundred products sorted by product id. Next you make a field editable by clicking in the Hide-Show-Edit block. You will see that for all the hundred products this field will become an input field You can edit the fields one by one. You can also use mass edit to edit them all at once. Once you are finished you press the Submit All button. Only then are the changes implemented in the database. Alternatively you can use the RowSubmit button at the end of each line. There is a demo-installation available. Username and password are the default. Below you find a view of the product-edit page where the description field has been made editable: Prestools is compatible with Prestashop 1.5, 1.6 and 1.7 and Thirty Bees. An old version for Prestashop 1.4 can be found here. For product-edit there are a few parts that are standard in demo mode. You can buy plugins at the Prestools website to use them. However, over 95% of the script is free. Among the files you will find a file prestoolssuite-module.zip. You can install this file as a module. It is a mini-module that adds a link to your Prestools installation in the Catalog menu of the backoffice. Prestools is regularly updated (on average once every two weeks). If you find a problem, please update Prestools to the latest version before you report it here. When reporting, please mention your Prestashop version. Bug reports and other suggestions for improvement are always welcome. Among the downloads you will find a manual. There is also an introduction video on Youtube (or here) to get started. It is very old but it gives you a short overview of the most used parts of the most used tool: product-edit. If you bought paid plugins and you download a newer version of the free software you should always also download the latest version of the paid plugins too. You can do that in your account. Prestools is regularly updated. Update regularly to get the newest features. Follow the installation instructions! This is not a module!
    1 point
  2. Καλά ναι, αμα θέλεις υπάρχει τρόπος, εγω το κάνω για τους τσαμπατζήδες που δεν ξέρουν τέτοια κόλπα 😁 Εχω δει ακόμα και πρόχειρες φωτογραφίες που τράβηξα με το κινητό να τις έχουν ανεβάσει άλλα e-shops Χώρια τις μεταφράσεις των κειμένων που ξοδεύω ώρες για να τις φτιάχνω Ευχαριστώ πολύ
    1 point
  3. Δωρεάν Module εδώ: https://catalogo-onlinersi.net/?id_product=229&controller=product&id_lang=6&yoReviewsPage=4 Σημείωσε πως με κάποιο εργαλείο debug όπως firebug & DevTools (πατάς F12) μπορεί κάποιος να εμφανίσει τον κώδικα και να πάρει κείμενα και φωτό. Αυτό δεν μπορείς να το κρύψεις αλλά πρέπει κάποιος να γνωρίζει αυτά τα εργαλεία.
    1 point
  4. So is 4 the total amount of cron jobs? wget "https://yoursite.com/modules/ps_facetedsearch/ps_facetedsearch-price-indexer.php? wget "https://yoursite.com/modules/ps_facetedsearch/ps_facetedsearch-attribute-indexer.php? wget "https://yoursite.com/admin/cron_currency_rates.php? wget "https://yoursite.com/modules/gsitemap/gsitemap-cron.php? Are there anymore?
    1 point
  5. You also have a cron job under shop parameters -> search
    1 point
  6. Hi and welcome to the forum To change that you need to make some CSS changes. First on line 13367 change/add two lines so it looks like #home-page-tabs{ padding-bottom: 10px; margin: 20px auto 10px; width: 100%; display: flex; } and also line 13939 change to .tabs .nav-tabs .nav-link { padding: 6px; font-size: 16px; } Save file, clear PrestaShop cache and it should make them horizontal.
    1 point
  7. Compatible with version: Prestashop 1.7+ Tutorial last update: 22/07/2021 Special thanks to following contributor(s): @mfdenis, @Inter Svetainė, @seblyon, @Oelita A while ago i received the question on how to add products programmatically using a PHP file. After looking around in the Prestashop files and searching the worldwide-web i have come up with a working script. I decided to share this code with the Prestashop community. If you have any questions our improvements don't hesitate to ask or say them. The file we are creating can be easily run with a cron-job and is able to fetch data from a page using JSON trough an Ajax call. Lets get started! The first step is creating a new PHP file in your admin folder. Create a new PHP file in the folder yourstore/back-office/FILENAME.php. In our small tutorial we use the filename importmyproduct.php Setting up connection with the config file First we start to check if the global variable _PS_ADMIN_DIR_ is defined. After we check that _PS_ADMIN_DIR_ is defined we will make connection with the prestashop config.inc.php file. So on top of our page we will add following code. <?php // Check if _PS_ADMIN_DIR_ is defined if (!defined('_PS_ADMIN_DIR_')) { // if _PS_ADMIN_DIR_ is not defined, define. define('_PS_ADMIN_DIR_', getcwd()); } // Setup connection with config.inc.php (required for database connection, ...) include(_PS_ADMIN_DIR_.'/../config/config.inc.php'); Adding access security and check if page is setup correctly. Since we do not want that our importmyproduct.php can be easily accessed by strangers we will add a security feature. We will also display our first echo to check if everything is working correctly. After we have setup our secure-key we can visit our PHP page by going to yourstore.com/yourbackoffice/importmyproduct.php?secure_key=yoursecuretoken $secure_key = 'ed3fa1ce558e1c2528cfbaa3f99403'; // Check if the client use the correct secure_key, url to use: www.yourstore.com/yourbackoffice/importmyproduct.php?secure_key=ed3fa1ce558e1c2528cfbaa3f99403 if(!Tools::getValue('secure_key') || Tools::getValue('secure_key') != $secure_key) { // If the secure_key is not set our not equal the php page will stop running. die('UNAUTHORIZED: We dont want you on this page!'); } echo 'Welcome, the secure_key you have used is correct. Now we can start adding product programmatically ... <br>'; Our product import function In this next step we will add our product import function which can be called later on to import a new product. function addProduct($ean13, $ref, $name, $qty, $text, $features, $price, $imgUrl, $catDef, $catAll) { $product = new Product(); // Create new product in prestashop $product->ean13 = $ean13; $product->reference = $ref; $product->name = createMultiLangField(utf8_encode($name)); $product->description = htmlspecialchars($text); $product->id_category_default = $catDef; $product->redirect_type = '301'; $product->price = number_format($price, 6, '.', ''); $product->minimal_quantity = 1; $product->show_price = 1; $product->on_sale = 0; $product->online_only = 0; $product->meta_description = ''; $product->link_rewrite = createMultiLangField(Tools::str2url($name)); // Contribution credits: mfdenis $product->add(); // Submit new product StockAvailable::setQuantity($product->id, null, $qty); // id_product, id_product_attribute, quantity $product->addToCategories($catAll); // After product is submitted insert all categories // Insert "feature name" and "feature value" if (is_array($features)) { foreach ($features as $feature) { $attributeName = $feature['name']; $attributeValue = $feature['value']; // 1. Check if 'feature name' exist already in database $FeatureNameId = Db::getInstance()->getValue('SELECT id_feature FROM ' . _DB_PREFIX_ . 'feature_lang WHERE name = "' . pSQL($attributeName) . '"'); // If 'feature name' does not exist, insert new. if (empty($FeatureNameId)) { Db::getInstance()->execute('INSERT INTO `' . _DB_PREFIX_ . 'feature` (`id_feature`,`position`) VALUES (0, 0)'); $FeatureNameId = Db::getInstance()->Insert_ID(); // Get id of "feature name" for insert in product Db::getInstance()->execute('INSERT INTO `' . _DB_PREFIX_ . 'feature_shop` (`id_feature`,`id_shop`) VALUES (' . $FeatureNameId . ', 1)'); Db::getInstance()->execute('INSERT INTO `' . _DB_PREFIX_ . 'feature_lang` (`id_feature`,`id_lang`, `name`) VALUES (' . $FeatureNameId . ', ' . Context::getContext()->language->id . ', "' . pSQL($attributeName) . '")'); } // 1. Check if 'feature value name' exist already in database $FeatureValueId = Db::getInstance()->getValue('SELECT id_feature_value FROM ' . _DB_PREFIX_ . 'feature_value WHERE id_feature_value IN (SELECT id_feature_value FROM `' . _DB_PREFIX_ . 'feature_value_lang` WHERE value = "' . pSQL($attributeValue) . '") AND id_feature = ' . $FeatureNameId); // If 'feature value name' does not exist, insert new. if (empty($FeatureValueId)) { Db::getInstance()->execute('INSERT INTO `' . _DB_PREFIX_ . 'feature_value` (`id_feature_value`,`id_feature`,`custom`) VALUES (0, ' . $FeatureNameId . ', 0)'); $FeatureValueId = Db::getInstance()->Insert_ID(); Db::getInstance()->execute('INSERT INTO `' . _DB_PREFIX_ . 'feature_value_lang` (`id_feature_value`,`id_lang`,`value`) VALUES (' . $FeatureValueId . ', ' . Context::getContext()->language->id . ', "' . pSQL($attributeValue) . '")'); } Db::getInstance()->execute('INSERT INTO `' . _DB_PREFIX_ . 'feature_product` (`id_feature`, `id_product`, `id_feature_value`) VALUES (' . $FeatureNameId . ', ' . $product->id . ', ' . $FeatureValueId . ')'); } } // add product image. $shops = Shop::getShops(true, null, true); $image = new Image(); $image->id_product = $product->id; $image->position = Image::getHighestPosition($product->id) + 1; $image->cover = true; if (($image->validateFields(false, true)) === true && ($image->validateFieldsLang(false, true)) === true && $image->add()) { $image->associateTo($shops); if (!uploadImage($product->id, $image->id, $imgUrl)) { $image->delete(); } } echo 'Product added successfully (ID: ' . $product->id . ')'; } We also will need a function to handle our image upload, add below following code: This function will insert the image into your store and assign it to your created product. function uploadImage($id_entity, $id_image = null, $imgUrl) { $tmpfile = tempnam(_PS_TMP_IMG_DIR_, 'ps_import'); $watermark_types = explode(',', Configuration::get('WATERMARK_TYPES')); $image_obj = new Image((int)$id_image); $path = $image_obj->getPathForCreation(); $imgUrl = str_replace(' ', '%20', trim($imgUrl)); // Evaluate the memory required to resize the image: if it's too big we can't resize it. if (!ImageManager::checkImageMemoryLimit($imgUrl)) { return false; } if (@copy($imgUrl, $tmpfile)) { ImageManager::resize($tmpfile, $path . '.jpg'); $images_types = ImageType::getImagesTypes('products'); foreach ($images_types as $image_type) { ImageManager::resize($tmpfile, $path . '-' . stripslashes($image_type['name']) . '.jpg', $image_type['width'], $image_type['height']); if (in_array($image_type['id_image_type'], $watermark_types)) { Hook::exec('actionWatermark', array('id_image' => $id_image, 'id_product' => $id_entity)); } } } else { unlink($tmpfile); return false; } unlink($tmpfile); return true; } Multi language support. As you can see in the above code we call the function createMultiLangField() This function make sure we add our product to all available languages on your store. Add the following function to your script. function createMultiLangField($field) { $res = array(); foreach (Language::getIDs(false) as $id_lang) { $res[$id_lang] = $field; } return $res; } The last step And after this all we come at our last step, adding our first programmatically created product. This can be done by calling our function addProduct and pass the necessary values. addProduct( '1234567891234', // Product EAN13 'Tutorial by Crezzur', // Product reference 'Crezzur', // Product name 5, // Product quantity 'Code by Crezzur (https://crezzur.com)', // Product description array( // Product features (array) array("name" => "Color", "value" => "Red"), array("name" => "Height", "value" => "200cm"), ), '999.95', // Product price 'https://crezzur.com/img/crezzur-logo-1544601440.jpg', // Product image 1, // Product default category array(1, 5) // All categorys for product (array) ); For the people that don't want to copy paste all the code we have created a file which contains all of the above the full code file can be found here : https://crezzur.com/en/modules/10-script-for-adding-prestashop-17-products-programmatically Using the code above will allow you to mass import products using a Ajax call (JSON) our using a CSV file. We do not add this code since the variables for each web service will be different. Generate Products Packs In PHP For those searching to import product packs with my code can find more information about this in the topic of @jmauclair A like and/or a thank you for my work is much appreciated
    1 point
  8. Hace unos días me contactó un cliente que empezaba a tener problemas de spam y registros diarios de usuarios "fantasmas" en su Prestashop, con datos falsos (bots). Lo primero que se me ocurrió fue buscar un módulo para integrar el recaptcha de Google en los formularios. Encontré uno gratuito, el eicaptcha, pero es para la versión v2, que obliga al usuario a tener que escribir un código o resolver un pequeño puzzle para pasar la verificación. La versión 3 en cambio, pasa desapercibida y normalmente no requiere intervención del usuario, por lo que resulta mucho menos "disuasoria" para el usuario legítimo que quiere enviar un mensaje o registrarse como cliente en la web. Por tanto, intenté localizar algo para la versión 3 del Recaptcha de Google, pero lo único que encontré fue un par de módulos comerciales, uno incluso se anunciaba como "con inteligencia artificial" y pedían 50 euros por él. Veo lógico que la gente quiera cobrar por su trabajo, pero me parece mucha cara "vender" algo con el reclamo de "inteligencia artificial", cuando esa inteligencia no la has programado tú, sino que estás usando un servicio de Google y tu módulo lo único que hace es integrarlo dentro de los formularios de Prestashop para que funcione, a un precio a mi juicio excesivo para lo que hace (modificar un par de formularios y realizar la verificación de un campo que además te da Google el resultado). De modo que le eché un vistazo a ver cómo funcionaba la integración (esta página me aclaró mucho las cosas), y me puse y en un par de horitas (o más bien 4 ó 5, porque cambié varias veces de opinión sobre los hooks a utilizar) tenía un módulo funcionando. Lo dejo aquí para quien lo necesite. Antes de usarlo, algunas consideraciones: El módulo lo he creado como he explicado, lo he probado en 2 instalaciones de Prestashop y en principio funciona sin problemas, lo adjunto aquí para quien lo quiera, pero es software gratis y "as-is", es decir, no ofrezco garantías de que vaya a funcionar en todos los casos, ni me hago responsable si no funciona como debería. En el caso de que lo instales, tú eres el responsable de comprobar que los formularios siguen funcionando de forma adecuada. Si no es así, con desactivarlo o desinstalarlo todo volverá a estar como antes. El módulo es para la versión 1.7.1 de Prestashop o superior. No funciona con versiones anteriores porque algunos de los "hooks" que utiliza creo que solo están presentes desde la versión 1.7.1. El módulo permite activar el recaptcha de forma general, y luego de forma particular en el formulario de registro, en de contacto y en el de suscripción a la newsletter, por separado. Si se activa en el formulario de registro, también se activará para el registro que se puede hacer directamente en el checkout y para la compra como invitado (esto es algo que está hecho así de forma intencionada, porque por ahí también te pueden colar registros "fantasmas"). No lo he probado en instalaciones que no usen el checkout estándar de Prestashop y lleven algún módulo de "compra en un paso", y no sé si opera correctamente con ellas o no. En principio, debido a la forma que tiene de funcionar no debería dar problemas, pero como no he hecho ninguna prueba, no puedo asegurarlo. Para que el módulo funcione necesitas, lógicamente, dos claves del recaptcha v3 de Google, la clave del sitio y la clave secreta. Esas claves las tienes que generar con tu cuenta de Google desde aquí: https://www.google.com/recaptcha/admin/create Para que funcione en el formulario de contacto debe estar actualizada la template de ese formulario para que incluya el hook del GDPR (ley de protección de datos). Las versiones recientes del módulo de contacto lo incluyen todas, pero hay temas que tienen hecho overrides de esa plantilla y no están actualizadas con ese hook. Lamentablemente, la template del módulo de contacto es el único hook que incluye, por lo que hay que utilizar ése. Cualquier problema que tengáis con él podéis ponerlo aquí e intentaremos solucionarlo. Versión 1.1 disponible: ftm_recaptchav3.zip
    1 point
  9. From my POV is BUG #462 in ProductController.php // replace // $combinations[$row['id_product_attribute']]['price'] = (float)Tools::convertPriceFull($row['price'], null, Context::getContext()->currency, false); // with this // $combinations[$row['id_product_attribute']]['price'] = (float)Tools::ps_round(Product::getPriceStatic((int)$this->product->id, false, $row['id_product_attribute'], 6), (int)Configuration::get('PS_PRICE_DISPLAY_PRECISION'));
    1 point
×
×
  • Create New...

Important Information

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