Jump to content

sdc

Members
  • Posts

    1
  • Joined

  • Last visited

Profile Information

  • Location
    France
  • Activity
    Project Owner

sdc's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi all, I am developing new module and at some point I trigger a discount from the module like this : $specificPrice = new SpecificPrice(); // dummy config $specificPrice->id_product = $id_product; $specificPrice->id_shop = $id_shop; ... $specificPrice->reduction = 0.09; $specificPrice->reduction_type = 'percentage'; $specificPrice->from = date('Y-m-d H:i:s'); $specificPrice->to = date('Y-m-d H:59:59'); $specificPrice->add(); the problem is that the discount is there (added to the DB) but the UI not updated (discount not displayed on the product price section). it is displayed only after refresh the product page some seconds later. same thing when delete the discount. it seems that the discount is triggered by the module after the product price is loaded to the UI. * is there any solution to make Prestashop aware that the product price has been changed and it should update itself? (like for example "invalidate()" in other APIs) * otherwise, when should I apply this discount because it seems that all prduct hooks are called too late after the product page is loaded? in other words, I want to trigger the discount before prestashop load the product price when loading the product page. so which product hook is called before that? any help will be appreciated.
×
×
  • Create New...