Announcement

Collapse
No announcement yet.

Changing product price according to period

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • yberges
    replied
    thanks !

    Leave a comment:


  • lazovic
    commented on 's reply
    Since you specified a Condition with a specific name, the formula will only work for that product anyway.

  • rabii
    replied
    use the code in formula of the Product Entity

    Leave a comment:


  • yberges
    replied
    juste a question how i can assign this formula to one product ?

    Leave a comment:


  • yberges
    replied
    hello cool i will test it thanks

    Leave a comment:


  • Vadym
    replied
    Hi yberges,

    As noted by the lazovic above, you need to change the c, d variables in the third part of the code to unique ones.
    Also, please note that Formula is required to put in Actions -> Execute Formula Script scope, instead Conditions scope.

    Click image for larger version

Name:	image.png
Views:	335
Size:	35.1 KB
ID:	81705

    Leave a comment:


  • lazovic
    commented on 's reply
    Please, in lines 9, 10 and 11, replace the letters “c” and “d” with “e” and “f”, for example.
    Otherwise, the whole third part of the formula will not work correctly.

  • yberges
    replied
    oki cool i will try !!!
    the first goal is
    before 1er sept : 200€
    to 2 au 29 sept : 220€
    after 29 sept : 260€
    Attached Files
    Last edited by yberges; 07-22-2022, 12:17 PM.

    Leave a comment:


  • Vadym
    replied
    Hi yberges,

    Such logic can be easily implemented by Formula:
    Code:
    $a = '2022-08-12';
    $b = '2022-09-12';
    ifThen(datetime\today() >= $a && datetime\today() <= $b, costPrice = 10);
    
    $c = '2022-09-13';
    $d = '2022-10-15';
    ifThen(datetime\today() >= $c && datetime\today() <= $d, costPrice = 20);
    Create a Workflow for Product entity with `After record saved (created or updated)` Trigger Type, add `Execute Formula Script` action and paste the formula inside.
    Also, if you don't have an Advanced Pack, you can insert the formula into Administration -> Entity Manager -> Product -> Formula.

    Documentation:

    Last edited by Vadym; 07-21-2022, 02:35 PM.

    Leave a comment:


  • yberges
    started a topic Changing product price according to period

    Changing product price according to period

    Hello is possible to change price of product according to date ?
    ex
    a product 15€
    between 12 august 12 septmbre 10€
    between 13 septmbre 15 october 20€
    regards
Working...
X