Skip to main content

Posts

Showing posts with the label is product in promotion

Start promotion in ecom store raw code

Steps to get product price based on promotion Step 1: calculateFinalPrice($product_id, $variant_id = null){ $prices = new PromotionalProduct($product_id, $variant_id = null); $prices->calculateProductPrice(); } class PromotionlProduct { public $product_id = null; public $variant_id = null; public $isPromotion = false; public $promotions; public $product_promotion_details; public product_details;     public function __construct($product_id,$variant_id=null){          $this->product_id = $product_id;           $this->variant_id = $variant_id;      }     public function  calculateProductPrice(){          //Step 2          $this->isPromotion = $this->isAnyPromotionIsStartRightNow();          //Step 3          //$this->isProductInPromotion();          //Step...