Ejemplo n.º 1
0
 public function getProductPluginInfo()
 {
     require_once SITE_ROOT . '/modules/EComm/plugins/products/ECommProduct.php';
     $hookResults = ECommProduct::adminPluginHooks("BeforeDisplayOrder", $this);
     //var_dump($hookResults);exit;
     return $hookResults;
 }
Ejemplo n.º 2
0
 public function calculatePrice()
 {
     //This method calls the getPrice method (which returns the base price) and then adds all the plugin prices
     //This method calcultes the price of the product plus the added price of the plugins
     require_once SITE_ROOT . '/modules/EComm/plugins/products/ECommProduct.php';
     $plugInPrices = ECommProduct::getPluginsPrice($this);
     return $plugInPrices + $this->getCartItemProduct()->getPrice();
 }
Ejemplo n.º 3
0
 public function getAddEditFormSaveHook($form)
 {
     if (@$_REQUEST[$this->quickformPrefix() . "no_image"]) {
         $this->setImage(0);
     } else {
         $newImage = $form->addElement('file', $this->quickformPrefix() . "image_upload", 'Image');
         if ($newImage->isUploadedFile()) {
             $im = new Image();
             $id = $im->insert($newImage->getValue());
             $this->setImage($id);
         }
     }
     $this->setLastModified(date('Y-m-d G:i:s'));
     $hookResults = ECommProduct::adminPluginHooks("BeforeSave", $this, $form);
 }
Ejemplo n.º 4
0
    {
    }
    public function adminHookBeforeDelete(&$product)
    {
    }
    public function adminHookAfterDelete(&$product)
    {
    }
    public function adminHookBeforeDisplayOrder(&$orderDetail)
    {
    }
    public function clientHookBeforeDisplayProduct(&$product, &$ecommModule)
    {
    }
    public function clientHookBeforeAddToCart(&$product, &$ecommModule)
    {
    }
    public function clientHookAfterAddToCart(&$cartItem, &$ecommModule)
    {
    }
    public function clientHookBeforeDisplayCartItem(&$cartItem, &$ecommModule)
    {
    }
    public function calculatePrice(&$cartItem)
    {
    }
}
ECommProduct::init("AlternativePics", false);
ECommProduct::init("ProductProperties");
ECommProduct::init("ChangeProductPrice");
Ejemplo n.º 5
0
 /**
  * Display a product
  * 
  * This function is called when a user is displaying a product
  *  
  * @return string
  */
 public function handleProduct($action, $page)
 {
     //$page, if exists, will be the product ID
     $product = new Product($page);
     if ($product->getId()) {
         //Display a product from the database
         $this->smarty->assign('product', $product);
         //After displaying the "standard" product, display all the plugin accessories
         require_once 'plugins/products/ECommProduct.php';
         $hookResults = ECommProduct::clientPluginHooks("BeforeDisplayProduct", $product, $this);
         $html = "";
         foreach ($hookResults as $key => $val) {
             $html .= @$val['HTML'];
         }
         $this->smarty->assign('html', $html);
         //And then display the "Go back" link
         $returnURL = @$_REQUEST["returnURL"];
         if (!$returnURL) {
             $returnURL = "/Store/";
         }
         $this->smarty->assign('returnURL', $returnURL);
     }
     return $this->smarty->fetch("Product.tpl");
 }