Jump to content

txabs

Members
  • Posts

    11
  • Joined

  • Last visited

Profile Information

  • Location
    Seville
  • Activity
    Freelancer

txabs's Achievements

Newbie

Newbie (1/14)

  • Conversation Starter Rare
  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

0

Reputation

  1. Hello, i'm trying to make a very simple script, to update product prices via PHP. <?php include(dirname(__FILE__) . '/config/config.inc.php'); $cod_articulo = 'B39821'; $mysqli = mysqli_connect($localhost, $user, $pass, $database) or die(mysql_error()); function getIdByReference($reference) { if (empty($reference)) { return 0; } if (!Validate::isReference($reference)) { return 0; } $query = new DbQuery(); $query->select('p.id_product'); $query->from('product', 'p'); $query->where('p.reference = \'' . pSQL($reference) . '\''); return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query); } $id_articulo = getIdByReference($cod_articulo); echo($id_articulo.'<br/>'); //check new Product($product); $product->price = '10'; echo($product->price.'<br/>'); $product->update(); // line 48 echo ('Producto con ref: '.$reference.' actualizado a '.$product->price.' euros'); ?> It returns this error PHP message: PHP Fatal error: Uncaught Error: Call to undefined method stdClass::update() in [***/testprecio.php:48 Stack trace:\n#0 {main}\n thrown in [***/testprecio.php on line 48' PS version 1.7.5.2 Do you know what i'm missing?? Thanks!! have a nice day
  2. Finally I solved the issue. I post the solution just in case anyone needs it. As ajankuv said, is more a .htaccess issue than prestashop itself. I just added in .htaccess the following lines: RewriteCond %{REQUEST_URI} ^/buscar$ (it's "buscar" because my site is in Spanish, it's just the search page)!! RewriteCond %{QUERY_STRING} ^controller=search&orderby=date_add&orderway=desc&search_query=[bRAND]&submit_search=$ RewriteRule (.) https://mysite.com/241-[bRAND]? [R=301,L] And duplicate the last two ones with every brand needing the redirection. Thanks a lot mate for your help @ajankuv
  3. Hi ajankuv. Sure, i've enabled they. In fact, i have several "normal" 301 redirects from former categories working without a problem. It's just this one with search query which I can't make work. Thanks for your response!
  4. Hi! I need to redirect 302 in Prestashop from a search page to a category. That's because a brand demands me to enter directly in their own category when anyone looks for it. I need Necesito hacer en prestashop una redirección 301 o 302, ya que una marca me exige que al buscar su nombre en el buscador vaya directamente a su categoría. Sería redirigir de una URL tipo: https://midominio.com/buscar?controller=search&orderby=date_add&orderway=desc&search_query=marca&submit_search= redirect to: https://midominio.com/123-marca I'm triying to do it on htaccess, but can't get it work. Redirect 301 /buscar?controller=search&orderby=date_add&orderway=desc&search_query=marca&submit_search= https://midominio.com/123-marca Could you please help me? Thanks!!
  5. Hola a todos! Necesito hacer en prestashop una redirección 301 o 302, ya que una marca me exige que al buscar su nombre en el buscador vaya directamente a su categoría. Sería redirigir de una URL tipo: https://midominio.com/buscar?controller=search&orderby=date_add&orderway=desc&search_query=marca&submit_search= redirigirlo a: https://midominio.com/123-marca Intento hacerlo en htaccess como tantas otras que tengo funcionando, pero esta no funciona Redirect 301 /buscar?controller=search&orderby=date_add&orderway=desc&search_query=marca&submit_search= https://midominio.com/123-marca ¿Podríais decirme qué estoy haciendo mal? Muchas gracias!
  6. No one knows what's happening? I'm having issues with my customers due to wrong size selection, I'll appreciate any help. Thanks
  7. Hi. I have problem with the attribute selection on my store. When you try to select an attribute (the shoes size), it ALWAYS autoselect the last one of the list, not the one you clicked on. It only fails the first time, the second time you select the size, it works fine. My store runs under prestashop 1.5.3.1, and URL is www.vandalsshoes.es. Anyone knows whats wrong?? Thank you.
  8. Hola buenos dias, os expongo mi problema. Mi tienda, www.vandalsshoes.es, al entrar en cualquier pagina de productos y seleccionar un atributo (talla), siempre se selecciona el ultimo de la lista. Me explico, si tienes tallas 37 (por defecto), 38, 39 y 40, y seleccionas la 38, se va a la 40 directamente. A partir de la segunda selección, funciona correctamente todo. Os dejo una pagina para que veais el problema http://www.vandalsshoes.es/adidas/634-adidas-rayado-grey.html La tienda funciona con PS 1.5.3.1. ¿Alguien sabe como se puede corregir esto? La tienda lleva mas de 6 meses abierta, y me he dado cuenta ahora del fallo. No puedo estar seguro, pero creo que antes no pasaba Muchas gracias
  9. He sustituido {$manufacturer.image|escape:'htmlall':'UTF-8'} por {$manufacturer.id_manufacturer} en el archivo manufacturer-list.tpl de la plantilla Solución propuesta por @rastavmp en este mismo foro.
  10. Gracias Shacker por tu interés, pero ya resolvi el asunto por mi mismo
  11. Buenos dias. En la página de mi tienda, en la URL http://www.vandalsshoes.es/fabricantes, ¿como puedo hacer para mostrar los logos de las marcas? He intentado ponerlas en el backend en Catálogo->Fabricantes, pero desde ahi no funciona. Muchas gracias
×
×
  • Create New...