Jump to content

devzk

Members
  • Posts

    10
  • Joined

  • Last visited

Profile Information

  • First Name
    Dev
  • Last Name
    zk

devzk's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Scully, thank you so much it was that. $order_state_id = $params['orderStatus']->id; I'll check anyways what $params contains for further information. Again, thanks!
  2. Hello, in my store when someone buys a product mailalerts send 2 emails. One for the customer and another for the admin/merchant configured in Mailalerts's BO settings. Via PHP I want to prevent mailalerts to send an email to admin/merchant when order state id equals 8. I checked mailalerts.php module and it has the hook function hookActionValidateOrder($params); I know inside $params there's an Order object and I can access it like $params['order']; So the default code (prestashop untouched) is: $order = $params['order']; And then I check if the state equals 8: if ($order->current_state == 8) { return; } But mailalerts keep sending the email. I'm checking the state in the right place? Thanks.
  3. Hello, I'm having an issue with the mailalerts module. I have a order state (ID: 8) indicating "error on payment". In BO, the state has checked the option: "Send email to customer when an order change to this state". Then I have a payment module (realexredirect - addon payments). Everytime a customer fails on its payment, mailalerts sends 2 emails. One for the customer (this one is fine) and another to the admin, saying "New order, but with an error message". I'm trying to avoid the second email. I searched inside module (mailalerts) and it has 2 hook functions that could be sending the second email ( in fact they do call Mail::send() ): - hookActionValidateOrder($params) - hookActionOrderReturn($params) In both I added: if($order->current_state == 8) { return; } But the module is still sending the second email. I searched for any reference of "Mail::class" or "Mail::send function" but it is not in there. (inside the payment module) What else could it be? Thanks!
  4. Hello, I'm trying to guess how to make a translation unique inside a foreach in smarty. I tried: {foreach from=$category} <a href="#">{l s='%s' sprintf=$category.name}</a> {/foreach} And also tried: {foreach from=$category} <a href="#">{l s=$category.name}</a> {/foreach} But any of two worked, with the first one I see just '%s' in the translation in BO, and with the second one is not even appearing in BO. I searched and I found a reference to {capture} http://www.smarty.net/docs/en/language.function.capture.tpl but I don't see the relation, because capture works with a unique name so I would be in the same trouble. How can I add as a translation something like the two examples? Thanks.
  5. Well, definitely works as expected, thanks to @Daresh. I built this script to delete products from Daresh's code: <?php require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.inc.php'); include(dirname(__FILE__) . '/init.php'); $res = Db::getInstance()->executeS('SELECT `id_product` FROM `'._DB_PREFIX_.'product` ORDER BY `id_product` DESC LIMIT 100 '); echo "<p>(".date('Y/m/d H:i:s').") Starting to delete products...</p>"; if ($res) { foreach ($res as $row) { echo "<p>(".date('Y/m/d H:i:s').") Deleting product with ID <b>".$row['id_product']."</b>..."; $p = new Product($row['id_product']); if(!$p->delete()) { echo " <span style='color: red'>Error deleting this product!</span></p>"; } else { echo " <span style='color: green'>DELETED</span></p>"; } } } So what I did was create a php file and place it on root's folder. Now I'm accessing it like: www.example.com/my-file.php I limited the execution every 100 products (due my server's timeout). For me it takes 30s aprox to execute and delete all 100 products.
  6. Okay, Thanks! I'll try and I'll post my results here so if anyone else is going through the same problem maybe could help.
  7. This PHP script will take the same effect as pressing "Delete" button from BO? I mean, all attributes, and specific prices depending on that product will be deleted?
  8. Hello, I'm wondering if there's any SQL script that could delete all products (and just products, not categories, or anything else) from my database. I searched and found this: https://www.prestashop.com/forums/topic/790[spam-filter]remove-all-products-from-the-database/, but it is from 2011, pretty old. I'm currently using prestashop 1.6.1.7 and I have 10,420 products in my catalog. I want to delete them all. I tried deleting every 10 products from BO, but it takes aprox. ~ 3min. Thanks.
  9. Hi, well yes I want that. I would not have any problem dealing with a huge discount I'll be careful. The thing is, a rule for Group 1 is applied to manufacturer 1 and Group 2 to manufacturer 2. So the discount only will apply if there are products of those manufacturers in customer's cart and just for those products. Any idea where to start? I'm wondering should exist a function in some controller (or core class) controlling if there's a specific price for X case. Yesterday I was looking SpecificPriceRule.php in /class/ folder, but I wasn't able to find any related. Must be anything like $customer->id_default_group, because I already dealed with this problem in 3 different modules. Thanks anyways for your preocupation!
  10. Hello, I'm using Prestashop 1.6.1.7 and I'm trying to figure out which file I need to modify to let catalog rules apply to all groups that are inside the rule, not just the default group. For example, if a Customer is in Group 1 and Group 2, but it's default group is Group 1, then a catalog rule for Group 2 won't work for that Customer. As I explained on the first place, I need the catalog rule apply for all customer groups, not just the default group. Thanks.
×
×
  • Create New...