Jump to content

Rúben Martins

Members
  • Posts

    26
  • Joined

  • Last visited

1 Follower

Contact Methods

Profile Information

  • Location
    Portugal
  • Interests
    Develop great web and mobile systems
  • Activity
    Web Development Agency

Recent Profile Visitors

3,396,443 profile views

Rúben Martins's Achievements

Newbie

Newbie (1/14)

  • First Post Rare
  • Collaborator Rare
  • Conversation Starter Rare
  • Week One Done Rare
  • One Month Later Rare

Recent Badges

2

Reputation

  1. Hi @AddWeb Solution thank you for the feedback, I've added to the classes/Contact.php and cleared the cache but still does not work. This is what I've, but with no effect For reference I've Prestashop 1.7.8.8. On another test I've commented the email field in the class and does not take any effect, so looks like this validation is done somewhere else? I've looked in the overide folder and theme and can't find anything that is overiding this. /** * @see ObjectModel::$definition */ public static $definition = [ 'table' => 'contact', 'primary' => 'id_contact', 'multilang' => true, 'fields' => [ 'email' => [ 'type' => self::TYPE_STRING, 'validate' => 'isEmail', 'size' => 255, ], 'customer_service' => [ 'type' => self::TYPE_BOOL, 'validate' => 'isBool', ], /* Lang fields */ 'name' => [ 'type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isName', 'required' => true, 'size' => 255, ], 'phone' => [ 'type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 12, 'required' => true, ], 'message' => [ 'type' => self::TYPE_STRING, 'validate' => 'isCleanHTML', 'size' => 50, 'required' => true, ], ], ];
  2. Thank you @ComGrafPL I believe that only applies to the checkout process, not a direct contact trough the contact form in the contact us page.
  3. Hi @AddWeb Solution In witch path can I find this file? Can you provide an example for the phone number and Name as required?
  4. Hello, Using the default contact form it only requires the subject(dropdown), email and message as mandatory by default, how can I set the remaining fields as mandatory like name and phone number? Tried this: but didn't help.
  5. Hello, I also have that issue with 1.6.1.x did you found a solution in the meantime?
  6. Hi, Anyone know how to hide/remove the wholesale price from an specific role from the back office? Thanks.
  7. Olá comunidade prestashop, Com isto recorro a vocês. Estou a ter um problema com o web service da prestashop e um software externo, encontro-me em desenvolvimento de um website desenvolvido através do prestashop e neste momento encontro-me a desenvolver uma interligação com o web service da prestashop que é disponibilizado através da página http://doc.prestashop.com/display/PS16/Using+the+PrestaShop+Web+Service onde já testei os exemplos e funciona perfeitamente com o recurso "customers" em adicionar/editar/visualizar. Contudo pretendo neste momento gerir os produtos através do web service que irá estar em ligação com um software externo de facturação onde contem todos os produtos e seu dados como stock e preços, para isso faço um pedido ao web service através de get com os seguintes parâmetros $opt = array('url' => PS_SHOP_PATH.'/api/products?display=full&filter[reference]=[XPTO]'); que me devolve os dados do producto com a referencia "XPTO" pois é o dado que existe em concordância no prestashop e software de facturação externo com isso pretendo verificar se o produto existe no prestashop através da referencia e isso funciona depois obtenho também os dados de produto e altero para os dados que obtenho do software externo mas ao tentar enviar o xml já com os dados editados devolve-me o erro "Other error This call to PrestaShop Web Services failed and returned an HTTP status of 400. That means: Bad Request." -------- Este é o codigo completo que estou a usar: <?php // Here we define constants /!\ You need to replace this parameters define('DEBUG', true); define('PS_SHOP_PATH', 'http://www.examplesite.com/prestashop'); define('PS_WS_AUTH_KEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); require_once('PSWebServiceLibrary.php'); //echo phpinfo(); // First : We always get the customer's list or a specific one try { $webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG); $opt = array('url' => PS_SHOP_PATH.'/api/products?display=full&filter[reference]=[FAC6.2454]'); $xml = $webService->get($opt); // Here we get the elements from children of customer markup which is children of prestashop root markup $resources = $xml->children()->children(); //$resources = $xml->children()->children()->children(); } catch (PrestaShopWebserviceException $e) { // Here we are dealing with errors $trace = $e->getTrace(); if ($trace[0]['args'][0] == 404) echo 'Bad Reference'; else if ($trace[0]['args'][0] == 401) echo 'Bad auth key'; else echo 'Other error - '.$e; } // We set the Title echo "<h1>Customer's List</h1>"; echo '<table border="5">'; // if $resources is set we can lists element in it otherwise do nothing cause there's an error if (!empty($resources)) { $data = array(); foreach ($resources->children() as $product => $resource) { echo '<tr><th>'.$product.'</th><td>'; echo '<input type="text" name="'.$product.'" value="'.$resource.'"/>'; echo '</td></tr>'; $data = array_merge($data, array($product => "".$resource)); } if (isset($data['id'])) // Here we check id cause in every resource there's an id { // Here we have XML before update, lets update XML with new values foreach ($resources->children() as $nodeKey => $node) { if($nodeKey=='ean13'){ $resources->children()->ean13 = (int)'123456'; } else{ $resources->children()->$nodeKey = $node; } } // And call the web service try { $opt = array('resource' => 'products'); $opt['putXml'] = $xml->asXML(); $opt['id'] = $data['id']; $xml = $webService->edit($opt); // if WebService don't throw an exception the action worked well and we don't show the following message echo "Successfully updated."; } catch (PrestaShopWebserviceException $ex) { // Here we are dealing with errors $trace = $ex->getTrace(); if ($trace[0]['args'][0] == 404) echo 'Bad ID'; else if ($trace[0]['args'][0] == 401) echo 'Bad auth key'; else echo 'Other error<br />'.$ex->getMessage(); } } } echo '</table>'; ?> --------------- Se possível me ajudem que já tentei varias situações e até ao momento ainda não consegui editar um produto através do web service, contudo os "customers" consigo fazer tudo dai acreditar que não seja problema do servidor/CURL/permissões. Ou me indiquem algum exemplo de como editar um produto através do web service. Obrigado, Rúben Martins
  8. Hi, I'm trying to get an specific product via web service with php and the library from prestashop PSWebServiceLibrary.php. I already try the examples provided from prestashop to get data via web service and work fine getting an product by id but i want to get the product by reference so i can update the data of some products from an external program. I think its something like this in first place but this doesn't work: for ($i = 1; $i <= $total_products; $i++) { try { $webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG); $opt = array('resource' => 'products'); if (isset($_GET['reference'])) $opt['reference'] = $_GET['reference']; $xml = $webService->get($opt); // Here we get the elements from children of customer markup which is children of prestashop root markup $resources = $xml->children()->children(); } catch (PrestaShopWebserviceException $e) { // Here we are dealing with errors $trace = $e->getTrace(); if ($trace[0]['args'][0] == 404) echo 'Bad ID'; else if ($trace[0]['args'][0] == 401) echo 'Bad auth key'; else echo 'Other error'; } } My final program will interacte an existing database from an external program with the daily stocks of products via web service into the web site build with prestashop. So i need to run a loop with all my products in an existing external program and from each product check if exists in the site prestashop by reference and then update the stock of then product and so on.. Can anyone help me? Tanks in advance, Rúben Martins
  9. I'm just wondered if someone else has of have similar problem with many categories in the system.... If someone have tested the system with many categories and whats the result...
  10. The stranger in this is that i also have around 6000 products in the same system for tests and that as no influence in the changes of any product and i can see one product has must more content to save at any change. And the categories is for about 700 and takes too long to do any change or add a new one. Any cache or some like that i think is not related because i already try the same 700 categories in a new and clean installation of the prestashop 1.5.5.0 and takes about the same time too change anything. I tried also too just import 150 categories for test in the same clean installation of prestashop and that starts too save slower than just with 20/30 categories, so i take the conclusion that is the amount of categories inserted in the system that makes that too long to do some changes. The strangest is that just happen in the categories all the rest work fine.
  11. Hi Benjamin, i clear manually that folders and the result is the same unfortunately :/ Hi pzi, i try to do that but that has no result :/ but thanks any way. just for curiosity, that is to do not regenerate the tree of the categories right? because as many categories and sub categories inside the categories, makes sens in theory.
  12. Hi to all. First of all tank u both of 3 to answer me, I will try to do the suggestions but maybe just tomorrow morning i will answer u guys. And i know stottycabanas, in this situations this questions needs to be done to clear any dubs but yes i already try to clear Smarty cache and had no effect. But tanks for asking.
  13. O erro pode estar no url que estás a colocar no browser pois nos servidores locais normalmente o url é "locahost/pasta_prestashopXXX" pois o htdocs é por defeito a pasta onde deves colocar os ficheiros e pastas de sites neste caso. Não incluas o htdocs no link.
  14. Hi. U need to change your base URI to "/prestasho_main/" and not "prestasho_main". this if u has the installation on your on line server in a folder "prestasho_main" but if the installation directly in your web server you just need to put "/" in your base URI. This you can made on the folder "config/settings.inc.php" in the line "define(‘__PS_BASE_URI__’, ‘/prestasho_main/’);"
×
×
  • Create New...