-
Posts
12 -
Joined
-
Last visited
Profile Information
-
Location
Madrid, Spain
-
First Name
Ray
-
Last Name
Rodriguez
Recent Profile Visitors
215 profile views
rayrodriguezg's Achievements
-
Unable to create an admin controller
rayrodriguezg replied to JordiCastillo's topic in Addons, modules and themes developers
Hi, Lo que te falte hacer seguramente es "reinicializar" el módulo desde el backoffice.... despues de hacerlo me ha funcionado, he tomado como guia el módulo: blockreassurance -> controllers -> admin -> AdminBlockListingController.php Si te fijas en el nombre del fichero no importa que no aparezca el nombre del módulo, lo que si debe coincidir es el nombre del fichero con el de la clase, class AdminBlockListingController extends ModuleAdminController Para llegar a esta conclusión he renombrado el controlador y la clase y no funcionaba... solo despues de reinicializar el módulo es que lo toma en cuenta como URL nueva, Espero os sirva, Saludos!! -
Hi, I have tried the exposed solutions but they do not work for me, According to my evaluation the problem is given because the allshops parameter is being sent in true without evaluating if we are in an allshops context, what I have done is to verify if we are in the context of allshops and pass that result as a variable to the method productAttributeExists since by default it is always being sent to true, with this it works correctly. the modifications are: and and the complety file is: Place this file in /override/controllers/admin/AdminProductsController.php and then delete the file /cache/class_index.php as usual <?php /* * 2007-2017 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2017 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ class AdminProductsController extends AdminProductsControllerCore { public function processProductAttribute() { // Don't process if the combination fields have not been submitted if (!Combination::isFeatureActive() || !Tools::getValue('attribute_combination_list')) { return; } if (Validate::isLoadedObject($product = $this->object)) { if ($this->isProductFieldUpdated('attribute_price') && (!Tools::getIsset('attribute_price') || Tools::getIsset('attribute_price') == null)) { $this->errors[] = Tools::displayError('The price attribute is required.'); } if (!Tools::getIsset('attribute_combination_list') || Tools::isEmpty(Tools::getValue('attribute_combination_list'))) { $this->errors[] = Tools::displayError('You must add at least one attribute.'); } $array_checks = array( 'reference' => 'isReference', 'supplier_reference' => 'isReference', 'location' => 'isReference', 'ean13' => 'isEan13', 'upc' => 'isUpc', 'wholesale_price' => 'isPrice', 'price' => 'isPrice', 'ecotax' => 'isPrice', 'quantity' => 'isInt', 'weight' => 'isUnsignedFloat', 'unit_price_impact' => 'isPrice', 'default_on' => 'isBool', 'minimal_quantity' => 'isUnsignedInt', 'available_date' => 'isDateFormat' ); foreach ($array_checks as $property => $check) { if (Tools::getValue('attribute_'.$property) !== false && !call_user_func(array('Validate', $check), Tools::getValue('attribute_'.$property))) { $this->errors[] = sprintf(Tools::displayError('Field %s is not valid'), $property); } } if (!count($this->errors)) { if (!isset($_POST['attribute_wholesale_price'])) { $_POST['attribute_wholesale_price'] = 0; } if (!isset($_POST['attribute_price_impact'])) { $_POST['attribute_price_impact'] = 0; } if (!isset($_POST['attribute_weight_impact'])) { $_POST['attribute_weight_impact'] = 0; } if (!isset($_POST['attribute_ecotax'])) { $_POST['attribute_ecotax'] = 0; } if (Tools::getValue('attribute_default')) { $product->deleteDefaultAttributes(); } $allShops = true; if (Shop::isFeatureActive()) { if(Shop::getContext() != Shop::CONTEXT_ALL) { $allShops = false; } } // Change existing one if (($id_product_attribute = (int)Tools::getValue('id_product_attribute')) || ($id_product_attribute = $product->productAttributeExists(Tools::getValue('attribute_combination_list'), false, null, $allShops, true))) { if ($this->tabAccess['edit'] === '1') { if ($this->isProductFieldUpdated('available_date_attribute') && (Tools::getValue('available_date_attribute') != '' &&!Validate::isDateFormat(Tools::getValue('available_date_attribute')))) { $this->errors[] = Tools::displayError('Invalid date format.'); } else { $product->updateAttribute((int)$id_product_attribute, $this->isProductFieldUpdated('attribute_wholesale_price') ? Tools::getValue('attribute_wholesale_price') : null, $this->isProductFieldUpdated('attribute_price_impact') ? Tools::getValue('attribute_price') * Tools::getValue('attribute_price_impact') : null, $this->isProductFieldUpdated('attribute_weight_impact') ? Tools::getValue('attribute_weight') * Tools::getValue('attribute_weight_impact') : null, $this->isProductFieldUpdated('attribute_unit_impact') ? Tools::getValue('attribute_unity') * Tools::getValue('attribute_unit_impact') : null, $this->isProductFieldUpdated('attribute_ecotax') ? Tools::getValue('attribute_ecotax') : null, Tools::getValue('id_image_attr'), Tools::getValue('attribute_reference'), Tools::getValue('attribute_ean13'), $this->isProductFieldUpdated('attribute_default') ? Tools::getValue('attribute_default') : null, Tools::getValue('attribute_location'), Tools::getValue('attribute_upc'), $this->isProductFieldUpdated('attribute_minimal_quantity') ? Tools::getValue('attribute_minimal_quantity') : null, $this->isProductFieldUpdated('available_date_attribute') ? Tools::getValue('available_date_attribute') : null, false); StockAvailable::setProductDependsOnStock((int)$product->id, $product->depends_on_stock, null, (int)$id_product_attribute); StockAvailable::setProductOutOfStock((int)$product->id, $product->out_of_stock, null, (int)$id_product_attribute); } } else { $this->errors[] = Tools::displayError('You do not have permission to add this.'); } } // Add new else { if ($this->tabAccess['add'] === '1') { if ($product->productAttributeExists(Tools::getValue('attribute_combination_list'))) { $this->errors[] = Tools::displayError('This combination already exists.'); } else { $id_product_attribute = $product->addCombinationEntity( Tools::getValue('attribute_wholesale_price'), Tools::getValue('attribute_price') * Tools::getValue('attribute_price_impact'), Tools::getValue('attribute_weight') * Tools::getValue('attribute_weight_impact'), Tools::getValue('attribute_unity') * Tools::getValue('attribute_unit_impact'), Tools::getValue('attribute_ecotax'), 0, Tools::getValue('id_image_attr'), Tools::getValue('attribute_reference'), null, Tools::getValue('attribute_ean13'), Tools::getValue('attribute_default'), Tools::getValue('attribute_location'), Tools::getValue('attribute_upc'), Tools::getValue('attribute_minimal_quantity'), array(), Tools::getValue('available_date_attribute') ); StockAvailable::setProductDependsOnStock((int)$product->id, $product->depends_on_stock, null, (int)$id_product_attribute); StockAvailable::setProductOutOfStock((int)$product->id, $product->out_of_stock, null, (int)$id_product_attribute); } } else { $this->errors[] = Tools::displayError('You do not have permission to').'<hr>'.Tools::displayError('edit here.'); } } if (!count($this->errors)) { $combination = new Combination((int)$id_product_attribute); $combination->setAttributes(Tools::getValue('attribute_combination_list')); // images could be deleted before $id_images = Tools::getValue('id_image_attr'); if (!empty($id_images)) { $combination->setImages($id_images); } $product->checkDefaultAttributes(); if (Tools::getValue('attribute_default')) { Product::updateDefaultAttribute((int)$product->id); if (isset($id_product_attribute)) { $product->cache_default_attribute = (int)$id_product_attribute; } if ($available_date = Tools::getValue('available_date_attribute')) { $product->setAvailableDate($available_date); } else { $product->setAvailableDate(); } } } } } } }
-
Overload the helper form.tpl file from an admin module ?
rayrodriguezg replied to Tak's topic in Core developers
Here solution: default : /backoffice/themes/default/template/controllers/orders/helpers/list override: /override/controllers/admin/templates/orders/helpers/list Regards! -
Soy desarrollador web desde hace unos años y desde hace 3 años mas o menos ando con prestashop... estaré a la orden para cualquier duda, Saludos!
-
Hello, to access yourwebsite.com/api you only need to register as a user the password generated from Advanced Parameters -> webservice. If you can not access in this way, activate the CGI mode for PHP from Advanced parameters -> webservice If you still can not connect, you can pass as a parameter to the url yourwebsite.com/api?ws_key=YOURKEY and you can connect. Regards!
-
Hello, with this module you can cancel the orders, configuring the times for each order status. And to finish the manual work, configure a cron task as often as you wish, https://addons.prestashop.com/en/order-management/27221-auto-cancel-orders.html Regards!
-
rayrodriguezg changed their profile photo
-
Ordenar campos en pa pagina de direccion de un cliente
rayrodriguezg replied to piribipipi's topic in Discusión general
Entras desde el backoffice a, localizacion -> pais Entras a modificar el pais que quieres y vas a conseguirte un textarea de este tipo firstname lastname company vat_number address1 address2 postcode city Country:name State:name phone phone_mobile Mueves el orden de los campos y listo! Esto es texto plano, pero asi funciona. Saludos!! -
Entra en backoffice Parametros avanzados -> Rendiemiento y verifica que este deshabilitada la opcion de Inhabilitar las sobre-cargas Me pasaba que de vez en cuando se generaba "mal" el class_index.php, era porque tenía esta opción activada, lo cúal hacía que generara el class_index.php sin ninguna referencia a mis overrides. Saludos!! AH y si lo regeneraba manualmente borrando el archivo y teniendo activa esta opción si lo hace bien (BUG de prestashop)